当前位置: 首页>>代码示例>>Java>>正文


Java User类代码示例

本文整理汇总了Java中org.oscm.provisioning.data.User的典型用法代码示例。如果您正苦于以下问题:Java User类的具体用法?Java User怎么用?Java User使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


User类属于org.oscm.provisioning.data包,在下文中一共展示了User类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toUserList

import org.oscm.provisioning.data.User; //导入依赖的package包/类
/**
 * Maps the given list of UsageLicenses to a list of User instances. Sets
 * user (name, id, ...) and subscription (admin, applicationUserId) specific
 * data.
 * 
 * @param usageLicenses
 *            the UsageLicenes to map
 * @return a list of User instances
 */
private List<User> toUserList(List<UsageLicense> usageLicenses) {
    List<User> users = new ArrayList<>();
    if (usageLicenses != null) {
        for (UsageLicense usageLicense : usageLicenses) {
            User userWithRole = new User();
            userWithRole.setApplicationUserId(
                    usageLicense.getApplicationUserId());
            PlatformUser platformUser = usageLicense.getUser();
            userWithRole.setUserId(platformUser.getUserId());
            userWithRole.setUserFirstName(platformUser.getFirstName());
            userWithRole.setUserLastName(platformUser.getLastName());
            userWithRole.setEmail(platformUser.getEmail());
            userWithRole.setLocale(platformUser.getLocale());
            RoleDefinition userRoleDefinition = usageLicense
                    .getRoleDefinition();
            if (userRoleDefinition != null) {
                userWithRole
                        .setRoleIdentifier(userRoleDefinition.getRoleId());
            }
            users.add(userWithRole);
        }
    }
    return users;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:34,代码来源:ApplicationServiceBean.java

示例2: createApplicationServiceMock

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private ApplicationServiceLocal createApplicationServiceMock()
        throws Exception {
    ApplicationServiceLocal applicationService = mock(ApplicationServiceLocal.class);

    doNothing().when(applicationService).deactivateInstance(
            any(Subscription.class));

    User user = new User();
    user.setApplicationUserId("applicationUserId");
    user.setUserId("user1");
    User[] users = new User[] { user };

    doReturn(users).when(applicationService).createUsers(eq(subscription),
            anyList());

    return applicationService;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:NotifyProvisioningServiceHandlerTest.java

示例3: asyncModifySubscription

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Override
public BaseResult asyncModifySubscription(String instanceId,
        String subscriptionId, String referenceId,
        List<ServiceParameter> parameterValues,
        List<ServiceAttribute> attributeValues, User requestingUser) {
    final HashMap<String, Setting> parameterMap = createParameterMap(
            parameterValues);
    final HashMap<String, Setting> attributeMap = createAttributeMap(
            attributeValues);
    logger.info("Modify parameters for instance {}: {}", instanceId,
            parameterMap);
    return modifySubscription(instanceId, subscriptionId, referenceId,
            parameterValues, attributeValues, parameterMap, attributeMap,
            ProvisioningStatus.WAITING_FOR_SYSTEM_MODIFICATION,
            requestingUser);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:17,代码来源:AsynchronousProvisioningProxy.java

示例4: testInstanceConnectServerError

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void testInstanceConnectServerError() throws Exception {
    // given
    requestInstanceProvisioning = false;
    setControllerReady = true;
    ServiceInstance si = createServiceInstance(
            ProvisioningStatus.WAITING_FOR_SYSTEM_CREATION,
            InstanceParameter.PUBLIC_IP);
    doReturn(getInstanceResult(0)).when(provService)
            .activateInstance(anyString(), any(User.class));
    doThrow(new SuspendException(ERROR_MESSAGE, RESPONSE_CODE))
            .when(controller).getInstanceStatus(anyString(),
                    any(ProvisioningSettings.class));

    // when
    handleTimer();

    // then
    String subject = Messages.get("en", "mail_server_connect_error.subject",
            si.getSubscriptionId());
    validateServiceInstanceStatus(
            ProvisioningStatus.WAITING_FOR_SYSTEM_CREATION);
    verify(mailService, times(1)).sendMail(anyListOf(String.class),
            eq(subject), anyString());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:26,代码来源:APPTimerServiceBeanIT.java

示例5: mapApplicationUserIdToLicense

import org.oscm.provisioning.data.User; //导入依赖的package包/类
/**
 * Maps the application user id back to the usage license and sets the
 * affected usage license dirty
 * 
 * @param licenses
 *            the usage licenses to update
 * @param createdUsers
 *            the user array containing the application user id
 */
private void mapApplicationUserIdToLicense(List<UsageLicense> licenses,
        User[] createdUsers) {
    if (createdUsers == null) {
        return;
    }
    String applicationUserId;
    for (UsageLicense license : licenses) {
        for (User createdUser : createdUsers) {
            applicationUserId = createdUser.getApplicationUserId();
            if (createdUser.getUserId()
                    .equals(license.getUser().getUserId())
                    && applicationUserId != null) {
                license.setApplicationUserId(applicationUserId);
                break;
            }
        }
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:28,代码来源:SubscriptionServiceBean.java

示例6: testHandleTimerOneWaitingServiceInstance

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void testHandleTimerOneWaitingServiceInstance() throws Exception {
    // given
    requestInstanceProvisioning = true;
    setControllerReady = true;
    createServiceInstance(ProvisioningStatus.WAITING_FOR_SYSTEM_CREATION,
            InstanceParameter.PUBLIC_IP);
    doReturn(getInstanceResult(0)).when(provService)
            .createInstance(any(InstanceRequest.class), any(User.class));

    // when
    handleTimer();

    // then
    verify(provFactoryBean, times(1))
            .getInstance(any(ServiceInstance.class));
    validateServiceInstanceStatus(ProvisioningStatus.COMPLETED);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:19,代码来源:APPTimerServiceBeanIT.java

示例7: testInstanceActivationError

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void testInstanceActivationError() throws Exception {
    // given
    requestInstanceProvisioning = false;
    setControllerReady = true;
    ServiceInstance si = createServiceInstance(
            ProvisioningStatus.WAITING_FOR_SYSTEM_ACTIVATION,
            InstanceParameter.PUBLIC_IP);
    doReturn(getInstanceResult(0)).when(provService)
            .activateInstance(anyString(), any(User.class));
    doThrow(new APPlatformException(ERROR_MESSAGE)).when(controller)
            .getInstanceStatus(anyString(),
                    any(ProvisioningSettings.class));

    // when
    handleTimer();

    // then
    String subject = Messages.get("en", "mail_activation_error.subject",
            si.getSubscriptionId());
    validateServiceInstanceStatus(ProvisioningStatus.COMPLETED);
    verify(mailService, times(1)).sendMail(anyListOf(String.class),
            eq(subject), anyString());
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:25,代码来源:APPTimerServiceBeanIT.java

示例8: testInstanceDeactivationError

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void testInstanceDeactivationError() throws Exception {
    // given
    requestInstanceProvisioning = false;
    setControllerReady = true;
    ServiceInstance si = createServiceInstance(
            ProvisioningStatus.WAITING_FOR_SYSTEM_DEACTIVATION,
            InstanceParameter.PUBLIC_IP);
    doReturn(getInstanceResult(0)).when(provService)
            .activateInstance(anyString(), any(User.class));
    doThrow(new APPlatformException("")).when(controller).getInstanceStatus(
            anyString(), any(ProvisioningSettings.class));

    // when
    handleTimer();

    // then
    String subject = Messages.get("en", "mail_deactivation_error.subject",
            si.getSubscriptionId());
    validateServiceInstanceStatus(ProvisioningStatus.COMPLETED);
    verify(mailService, times(1)).sendMail(anyListOf(String.class),
            eq(subject), anyString());
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:24,代码来源:APPTimerServiceBeanIT.java

示例9: testHandleTimerOneDeletingServiceInstance_Ready

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void testHandleTimerOneDeletingServiceInstance_Ready()
        throws Exception {
    // given
    requestInstanceProvisioning = true;
    setControllerReady = true;
    createServiceInstance(ProvisioningStatus.WAITING_FOR_SYSTEM_DELETION,
            InstanceParameter.PUBLIC_IP);
    doReturn(getInstanceResult(0)).when(provService).deleteInstance(
            anyString(), anyString(), anyString(), any(User.class));

    // when
    handleTimer();

    // then
    verify(provFactoryBean, times(1))
            .getInstance(any(ServiceInstance.class));
    validateServiceInstanceStatus(ProvisioningStatus.COMPLETED);
    validateServiceInstanceFlags(null, new Boolean[] { Boolean.FALSE },
            new Boolean[] { Boolean.TRUE });
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:22,代码来源:APPTimerServiceBeanIT.java

示例10: testHandleTimerVerifyBESNotificationOnCompletion

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void testHandleTimerVerifyBESNotificationOnCompletion()
        throws Exception {
    // given
    requestInstanceProvisioning = true;
    setControllerReady = true;
    createServiceInstance(ProvisioningStatus.WAITING_FOR_SYSTEM_CREATION,
            InstanceParameter.PUBLIC_IP);
    doReturn(getInstanceResult(0)).when(provService)
            .createInstance(any(InstanceRequest.class), any(User.class));

    // when
    handleTimer();

    // then
    verify(besDAOMock).notifyAsyncSubscription(any(ServiceInstance.class),
            any(InstanceResult.class), eq(true),
            any(APPlatformException.class));
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:20,代码来源:APPTimerServiceBeanIT.java

示例11: testHandleTimerVerifyBESNotificationOnMailSend

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void testHandleTimerVerifyBESNotificationOnMailSend()
        throws Exception {
    // given
    requestInstanceProvisioning = true;
    setControllerReady = true;
    doReturn(new VOUserDetails()).when(configService).getAPPAdministrator();
    doThrow(new APPlatformException("")).when(controller).getInstanceStatus(
            anyString(), any(ProvisioningSettings.class));
    doThrow(new BESNotificationException("", new Throwable()))
            .when(timerService).notifyOnProvisioningAbortion(
                    any(ServiceInstance.class), any(InstanceResult.class),
                    any(APPlatformException.class));
    createServiceInstance(ProvisioningStatus.WAITING_FOR_SYSTEM_CREATION,
            InstanceParameter.PUBLIC_IP);
    doReturn(getInstanceResult(1)).when(provService)
            .createInstance(any(InstanceRequest.class), any(User.class));

    // when
    handleTimer();

    // then
    verify(mailService, times(1)).sendMail(anyListOf(String.class),
            anyString(), anyString());
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:26,代码来源:APPTimerServiceBeanIT.java

示例12: asyncModifySubscription

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void asyncModifySubscription() {
    // given
    when(service.asyncModifySubscription(anyString(), anyString(),
            anyString(), anyListOf(ServiceParameter.class),
            anyListOf(ServiceAttribute.class), any(User.class)))
                    .thenReturn(baseResult);
    // when
    BaseResult result = adapter.asyncModifySubscription(ASYNC,
            SUBSCRIPTIONID, REFERENCEID, params, attr, null);
    // then
    assertEquals(ASYNC, result.getDesc());
    verify(service).asyncModifySubscription(same(ASYNC),
            same(SUBSCRIPTIONID), same(REFERENCEID), same(params),
            same(attr), any(User.class));
    verifyZeroInteractions(params);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:ProvisioningServiceAdapterV1_0Test.java

示例13: createUsers

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@Test
public void createUsers() throws TechnicalServiceNotAliveException,
        TechnicalServiceOperationException {
    Subscription sub = createSubscription(true);
    addUsageLicense(sub, "test1");
    addUsageLicense(sub, "test2");
    PlatformUser user = sub.getUsageLicenses().get(0).getUser();

    User[] users = am.createUsersForSubscription(sub);
    assertEquals(2, users.length);
    assertEquals(user.getUserId(), users[0].getUserId());
    assertEquals(user.getUserId(), users[0].getApplicationUserId());
    assertEquals(user.getEmail(), users[0].getEmail());
    assertEquals(user.getLocale(), users[0].getLocale());
    assertEquals(user.getUserId(), users[0].getUserLastName());
    assertNotNull(servicePort.getRequestingUser());
    assertTrue(servicePort.getRequestingUser().getEmail().length() > 0);
    assertTrue(servicePort.getRequestingUser().getUserId().length() > 0);
    assertTrue(servicePort.getRequestingUser().getUserFirstName()
            .length() > 0);
    assertTrue(
            servicePort.getRequestingUser().getUserLastName().length() > 0);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:24,代码来源:ApplicationServiceBeanTest.java

示例14: testUpdateUsers_NoProvOnInstance

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testUpdateUsers_NoProvOnInstance() throws Exception {
    final String instanceId = createService(ProvisioningStatus.COMPLETED);
    final List<User> users = new ArrayList<>();
    final BaseResult result = new BaseResult();
    result.setRc(1);

    doReturn(result).when(provServiceMock).updateUsers(instanceId, users,
            null);
    when(
            controllerMock.updateUsers(anyString(),
                    any(ProvisioningSettings.class), any(List.class)))
            .thenReturn(new InstanceStatus());

    BaseResult ur = runTX(new Callable<BaseResult>() {
        @Override
        public BaseResult call() {
            return proxy.updateUsers(instanceId, users, null);
        }
    });
    // OK result because provisioning on instance has never been called
    Assert.assertEquals(0, ur.getRc());
    verifyZeroInteractions(provServiceMock);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:26,代码来源:AsynchronousProvisioningProxyIT.java

示例15: testDeleteUsers_NoProvOnInstance

import org.oscm.provisioning.data.User; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testDeleteUsers_NoProvOnInstance() throws Exception {
    final String instanceId = createService(ProvisioningStatus.COMPLETED);
    final List<User> users = new ArrayList<>();
    final BaseResult result = new BaseResult();
    result.setRc(1);

    doReturn(result).when(provServiceMock).deleteUsers(instanceId, users,
            null);
    when(
            controllerMock.deleteUsers(anyString(),
                    any(ProvisioningSettings.class), any(List.class)))
            .thenReturn(new InstanceStatus());

    BaseResult ur = runTX(new Callable<BaseResult>() {
        @Override
        public BaseResult call() {
            return proxy.deleteUsers(instanceId, users, null);
        }
    });
    // OK result because provisioning on instance has never been called
    Assert.assertEquals(0, ur.getRc());
    verifyZeroInteractions(provServiceMock);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:26,代码来源:AsynchronousProvisioningProxyIT.java


注:本文中的org.oscm.provisioning.data.User类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。