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


Java VOSubscription.setUnitKey方法代码示例

本文整理汇总了Java中org.oscm.vo.VOSubscription.setUnitKey方法的典型用法代码示例。如果您正苦于以下问题:Java VOSubscription.setUnitKey方法的具体用法?Java VOSubscription.setUnitKey怎么用?Java VOSubscription.setUnitKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscm.vo.VOSubscription的用法示例。


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

示例1: bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminSubManager

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminSubManager() throws Exception {
    //given
    List<VOUda> udasToSave = prepareUdasForSave();
    VOSubscription subscription = createSubscription();
    subscription.setUnitKey(unitBug12379.getKey());
    subscription.setUnitName(unitBug12379.getName());

    organizationalUnitService.revokeUserRoles(unitAdminSubManager, Arrays.asList(UnitRoleType.USER), unitBug12379);
    organizationalUnitService.grantUserRoles(unitAdminSubManager, Arrays.asList(org.oscm.types.enumtypes.UnitRoleType.ADMINISTRATOR), unitBug12379);
    //when
    service4UnitAdminSubManager = ServiceFactory.getDefault()
            .getSubscriptionService(
                    String.valueOf(unitAdminSubManager.getKey()),
                    WebserviceTestBase.DEFAULT_PASSWORD);
    VOSubscription voSubscription = service4UnitAdminSubManager.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
    //then
    assertEquals(voSubscription.getUnitKey(), unitBug12379.getKey());
    assertEquals(voSubscription.getUnitName(), unitBug12379.getName());
    service4UnitAdminSubManager.unsubscribeFromService(voSubscription.getSubscriptionId());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:22,代码来源:SubscriptionServiceWSTest.java

示例2: bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminOnly

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminOnly() throws Exception {
    //given
    List<VOUda> udasToSave = prepareUdasForSave();
    VOSubscription subscription = createSubscription();
    subscription.setUnitKey(unitBug12379.getKey());
    subscription.setUnitName(unitBug12379.getName());
    organizationalUnitService.revokeUserRoles(unitAdminOnly, Arrays.asList(UnitRoleType.USER), unitBug12379);
    organizationalUnitService.grantUserRoles(unitAdminOnly, Arrays.asList(org.oscm.types.enumtypes.UnitRoleType.ADMINISTRATOR), unitBug12379);
    service4UnitAdminOnly = ServiceFactory.getDefault()
            .getSubscriptionService(
                    String.valueOf(unitAdminOnly.getKey()),
                    WebserviceTestBase.DEFAULT_PASSWORD);
    //when
    VOSubscription voSubscription = service4UnitAdminOnly.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
    waitForLogStored();
    //then
    assertEquals(voSubscription.getUnitKey(), unitBug12379.getKey());
    assertEquals(voSubscription.getUnitName(), unitBug12379.getName());
    service4UnitAdminOnly.unsubscribeFromService(voSubscription.getSubscriptionId());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:22,代码来源:SubscriptionServiceWSTest.java

示例3: bug12379_subscriptionToServiceWithUnitAssignedByApi_subManagerOnly

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test(expected = OperationNotPermittedException.class)
public void bug12379_subscriptionToServiceWithUnitAssignedByApi_subManagerOnly() throws Exception {
    //given
    List<VOUda> udasToSave = prepareUdasForSave();
    VOSubscription subscription = createSubscription();
    subscription.setUnitKey(unitBug12379.getKey());
    subscription.setUnitName(unitBug12379.getName());
    service4SubManagerOnly = ServiceFactory.getDefault()
            .getSubscriptionService(
                    String.valueOf(subManagerOnly.getKey()),
                    WebserviceTestBase.DEFAULT_PASSWORD);
    //when
    VOSubscription voSubscription = service4SubManagerOnly.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
    //then
    assertEquals(unitBug12379.getKey(), voSubscription.getUnitKey());
    assertEquals(unitBug12379.getName(), voSubscription.getUnitName());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:SubscriptionServiceWSTest.java

示例4: bug12379_subscriptionToServiceWithUnitAssignedByApi_notUnitAdminNotSubManager

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
@Test
public void bug12379_subscriptionToServiceWithUnitAssignedByApi_notUnitAdminNotSubManager() throws Exception {
    //given
    List<VOUda> udasToSave = prepareUdasForSave();
    VOSubscription subscription = createSubscription();
    subscription.setUnitKey(unitBug12379.getKey());
    subscription.setUnitName(unitBug12379.getName());
    service4notUnitAdminNotSubManager = ServiceFactory.getDefault()
            .getSubscriptionService(
                    String.valueOf(notUnitAdminNotSubManager.getKey()),
                    WebserviceTestBase.DEFAULT_PASSWORD);
    //when
    try {
        service4notUnitAdminNotSubManager.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
    } catch (ServerSOAPFaultException e) {
        //then
        assertTrue(e.getMessage().contains("javax.ejb.EJBAccessException"));
    }
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:20,代码来源:SubscriptionServiceWSTest.java


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