本文整理汇总了Java中org.oscm.types.exceptions.OperationNotPermittedException类的典型用法代码示例。如果您正苦于以下问题:Java OperationNotPermittedException类的具体用法?Java OperationNotPermittedException怎么用?Java OperationNotPermittedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperationNotPermittedException类属于org.oscm.types.exceptions包,在下文中一共展示了OperationNotPermittedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyAsyncModifySubscription_completion
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncModifySubscription_completion()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
VOInstanceInfo info = new VOInstanceInfo();
doReturn(info).when(besDAO).getInstanceInfo(any(ServiceInstance.class),
any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
// when
besDAO.notifyAsyncModifySubscription(si, new InstanceResult(), true,
new APPlatformException(""));
// then
verify(subServ).completeAsyncModifySubscription(si.getSubscriptionId(),
si.getOrganizationId(), info);
}
示例2: notifyAsyncSubscription_completion_OperationNotPermited
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test(expected = BESNotificationException.class)
public void notifyAsyncSubscription_completion_OperationNotPermited()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
OrganizationAuthoritiesException, OperationNotPermittedException,
ValidationException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new OperationNotPermittedException()).when(subServ)
.completeAsyncSubscription(anyString(), anyString(),
any(VOInstanceInfo.class));
// when
besDAO.notifyAsyncSubscription(si, new InstanceResult(), true,
new APPlatformException(""));
}
示例3: useCase6_createMarketableService
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
private void useCase6_createMarketableService() throws Exception {
VOService service = createMarketableService("marketableService1",
tp1_ts1, supp1_adminKey, supp1.getOrganizationId());
assertNotNull(service);
assertEquals("marketableService1", service.getServiceId());
assertTrue(service.getKey() > 0);
// alteration 4a
removeMarketingPermissions(tp1_ts1,
Arrays.asList(supp3.getOrganizationId()), tp1_adminKey);
try {
createMarketableService("marketableService2", tp1_ts1,
supp3_adminKey, supp3.getOrganizationId());
fail();
} catch (OperationNotPermittedException e) {
assertEquals("ex.OperationNotPermittedException", e.getMessageKey());
assertNull(e.getMessageParams());
assertTrue(e.getMessage().contains(supp3.getOrganizationId()));
}
}
示例4: notifyAsyncModifySubscription_abortion_OperationNotPermited
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test(expected = BESNotificationException.class)
public void notifyAsyncModifySubscription_abortion_OperationNotPermited()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new OperationNotPermittedException()).when(subServ)
.abortAsyncModifySubscription(anyString(), anyString(),
anyListOf(VOLocalizedText.class));
// when
besDAO.notifyAsyncModifySubscription(si, new InstanceResult(), false,
new APPlatformException(""));
}
示例5: notifyAsyncUpgradeSubscription_completion_ObjectNotFound
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncUpgradeSubscription_completion_ObjectNotFound()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new ObjectNotFoundException()).when(subServ)
.completeAsyncUpgradeSubscription(anyString(), anyString(),
any(VOInstanceInfo.class));
// when
besDAO.notifyAsyncUpgradeSubscription(si, new InstanceResult(), true,
new APPlatformException(""));
// then no exception
}
示例6: notifyAsyncSubscription_abortion_ObjectNotFound
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncSubscription_abortion_ObjectNotFound()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new ObjectNotFoundException()).when(subServ)
.abortAsyncSubscription(anyString(), anyString(),
anyListOf(VOLocalizedText.class));
// when
besDAO.notifyAsyncSubscription(si, new InstanceResult(), false,
new APPlatformException(""));
// then no exception
}
示例7: deleteUnit
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
@Order(order = 7)
public void deleteUnit() throws NonUniqueBusinessKeyException,
MailOperationException, ObjectNotFoundException,
DeletionConstraintException, OperationNotPermittedException {
// given
final String unitName = randomString("TestUnit");
final String unitDesc = randomString("TestDesc");
final String unitRefId = randomString("refId");
// when
unitService.createUnit(unitName, unitDesc, unitRefId);
unitService.deleteUnit(unitName);
// then
VOOrganizationalUnit unit = getUnitWithName(unitName);
Assert.assertNull(unit);
}
示例8: notifyAsyncUpgradeSubscription_abortion_SubscriptionState
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncUpgradeSubscription_abortion_SubscriptionState()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new SubscriptionStateException()).when(subServ)
.abortAsyncUpgradeSubscription(anyString(), anyString(),
anyListOf(VOLocalizedText.class));
doNothing().when(besDAO).handleSubscriptionStateException(
any(ServiceInstance.class), any(InstanceResult.class),
eq(false), any(SubscriptionStateException.class));
// when
besDAO.notifyAsyncUpgradeSubscription(si, new InstanceResult(), false,
new APPlatformException(""));
// then no exception
}
示例9: notifyAsyncUpgradeSubscription_completion_SubscriptionState
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncUpgradeSubscription_completion_SubscriptionState()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new SubscriptionStateException()).when(subServ)
.completeAsyncUpgradeSubscription(anyString(), anyString(),
any(VOInstanceInfo.class));
doNothing().when(besDAO).handleSubscriptionStateException(
any(ServiceInstance.class), any(InstanceResult.class),
eq(true), any(SubscriptionStateException.class));
// when
besDAO.notifyAsyncUpgradeSubscription(si, new InstanceResult(), true,
new APPlatformException(""));
// then no exception
}
示例10: notifyAsyncModifySubscription_abortion
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncModifySubscription_abortion()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
VOInstanceInfo info = new VOInstanceInfo();
doReturn(info).when(besDAO).getInstanceInfo(any(ServiceInstance.class),
any(InstanceResult.class));
List<VOLocalizedText> besText = new ArrayList<>();
besText.add(new VOLocalizedText("de", "text"));
doReturn(besText).when(besDAO).toBES(anyListOf(LocalizedText.class));
ServiceInstance si = givenServiceInstance(false);
APPlatformException cause = new APPlatformException("");
// when
besDAO.notifyAsyncModifySubscription(si, new InstanceResult(), false,
cause);
// then
verify(subServ).abortAsyncModifySubscription(
eq(si.getSubscriptionId()), eq(si.getOrganizationId()),
eq(besText));
}
示例11: notifyAsyncUpgradeSubscription_abortion
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncUpgradeSubscription_abortion()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
VOInstanceInfo info = new VOInstanceInfo();
doReturn(info).when(besDAO).getInstanceInfo(any(ServiceInstance.class),
any(InstanceResult.class));
List<VOLocalizedText> besText = new ArrayList<>();
besText.add(new VOLocalizedText("de", "text"));
doReturn(besText).when(besDAO).toBES(anyListOf(LocalizedText.class));
ServiceInstance si = givenServiceInstance(false);
APPlatformException cause = new APPlatformException("");
// when
besDAO.notifyAsyncUpgradeSubscription(si, new InstanceResult(), false,
cause);
// then
verify(subServ).abortAsyncUpgradeSubscription(
eq(si.getSubscriptionId()), eq(si.getOrganizationId()),
eq(besText));
}
示例12: addRevokeUserUnitAssignment_DefaultUnit
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test(expected = OperationNotPermittedException.class)
public void addRevokeUserUnitAssignment_DefaultUnit() throws Exception {
List<VOUser> usersToBeAdded = new ArrayList<VOUser>();
VOUser user = new VOUser();
user.setKey(111L);
usersToBeAdded.add(user);
List<VOUser> usersToBeRevoked = new ArrayList<VOUser>();
String unitName = "default";
try {
is.addRevokeUserUnitAssignment(unitName, usersToBeAdded,
usersToBeRevoked);
} catch (OperationNotPermittedException e) {
validateException(e);
throw e;
}
}
示例13: notifyAsyncSubscription_completion
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncSubscription_completion()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
OrganizationAuthoritiesException, OperationNotPermittedException,
ValidationException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
VOInstanceInfo info = new VOInstanceInfo();
doReturn(info).when(besDAO).getInstanceInfo(any(ServiceInstance.class),
any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
// when
besDAO.notifyAsyncSubscription(si, new InstanceResult(), true,
new APPlatformException(""));
// then
verify(subServ).completeAsyncSubscription(si.getSubscriptionId(),
si.getOrganizationId(), info);
}
示例14: notifyAsyncUpgradeSubscription_completion_OperationNotPermited
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test(expected = BESNotificationException.class)
public void notifyAsyncUpgradeSubscription_completion_OperationNotPermited()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new OperationNotPermittedException()).when(subServ)
.completeAsyncUpgradeSubscription(anyString(), anyString(),
any(VOInstanceInfo.class));
// when
besDAO.notifyAsyncUpgradeSubscription(si, new InstanceResult(), true,
new APPlatformException(""));
}
示例15: notifyAsyncModifySubscription_completion_ObjectNotFound
import org.oscm.types.exceptions.OperationNotPermittedException; //导入依赖的package包/类
@Test
public void notifyAsyncModifySubscription_completion_ObjectNotFound()
throws APPlatformException, BESNotificationException,
ObjectNotFoundException, SubscriptionStateException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
OrganizationAuthoritiesException, OperationNotPermittedException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
doReturn(new VOInstanceInfo()).when(besDAO).getInstanceInfo(
any(ServiceInstance.class), any(InstanceResult.class));
ServiceInstance si = givenServiceInstance(false);
doThrow(new ObjectNotFoundException()).when(subServ)
.completeAsyncModifySubscription(anyString(), anyString(),
any(VOInstanceInfo.class));
// when
besDAO.notifyAsyncModifySubscription(si, new InstanceResult(), true,
new APPlatformException(""));
// then no exception
}