use of com.adaptris.core.ServiceException in project interlok by adaptris.
the class VerifyIdentityServiceTest method testDefaultService.
@Test
public void testDefaultService() throws Exception {
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
msg.addMetadata(USER, getName() + ThreadLocalRandom.current().nextInt());
msg.addMetadata(PASSWORD, getName() + ThreadLocalRandom.current().nextInt());
msg.addMetadata(ROLE, getName() + ThreadLocalRandom.current().nextInt());
VerifyIdentityService service = new VerifyIdentityService();
try {
execute(service, msg);
fail();
} catch (ServiceException expected) {
}
}
use of com.adaptris.core.ServiceException in project interlok by adaptris.
the class EncryptionServiceCase method testRoundTripWithBadMetadata.
@Test
public void testRoundTripWithBadMetadata() throws Exception {
String url = createKeystore();
CoreSecurityService input = create();
applyConfigForTests(input, url);
input.setRemotePartner(null);
input.setRemotePartnerMetadataKey("MyRemotePartner");
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(EXAMPLE_MSG);
msg.addMetadata(CoreConstants.SECURITY_REMOTE_PARTNER, PROPERTIES.getProperty(SECURITY_ALIAS));
try {
execute(input, msg);
fail("Expected Exception from doService");
} catch (ServiceException e) {
;
}
}
use of com.adaptris.core.ServiceException in project interlok by adaptris.
the class GunzipServiceTest method testUnZipWithInvalidZip.
@Test
public void testUnZipWithInvalidZip() throws Exception {
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(LINE);
try {
execute(new GunzipService(), msg);
fail("Gunzip on [" + LINE + "] succeeded");
} catch (ServiceException expected) {
;
}
}
use of com.adaptris.core.ServiceException in project interlok by adaptris.
the class GzipServiceTest method testZipServiceFailure.
@Test
public void testZipServiceFailure() throws Exception {
AdaptrisMessage msg = new DefectiveMessageFactory().newMessage(LINE, "UTF-8");
try {
execute(new GzipService(), msg);
fail();
} catch (ServiceException expected) {
;
}
}
use of com.adaptris.core.ServiceException in project interlok by adaptris.
the class InputOutputServiceTest method testService_BrokenInput.
@Test
public void testService_BrokenInput() throws Exception {
AdaptrisMessage msg = new DefectiveMessageFactory(DefectiveMessageFactory.WhenToBreak.INPUT).newMessage("hello world");
try {
execute(new InputOutputService(), msg);
fail();
} catch (ServiceException expected) {
}
}
Aggregations