UnknownSourceBean bean = e.getFaultInfo();
assertEquals("unknown", bean.getSourceId());
assertEquals(888, bean.getErrorCode());
}
assertEquals("newid", sourceService.addInfoSet("somesource", new InfoSet()));
assertEquals("okay", sourceService.addInfoSet("othersource", new InfoSet()));
assertEquals("intercepted", sourceService.addInfoSet("SPECIAL", new InfoSet()));
assertEquals("intercepted2", sourceService.addInfoSet("SPECIAL2", new InfoSet()));
assertEquals("resourceId", sourceService.addInfoSet("resource", new InfoSet()));
try {
sourceService.addInfoSet("unknown", new InfoSet());
fail("Should have thrown the exception.");
}
catch (ServiceException e) {
assertEquals("unknown source id", e.getMessage());
assertEquals("anyhow", e.getAnotherMessage());