use of com.adaptris.core.cache.Cache in project interlok by adaptris.
the class RetrieveFromCacheServiceTest method testDoService_ExceptionIfNotFound_NotFound.
@Test
public void testDoService_ExceptionIfNotFound_NotFound() throws Exception {
AdaptrisMessage msg = createMessage("Hello World", Arrays.asList(new MetadataElement[] { new MetadataElement(SRC_METADATA_KEY, LOOKUP_VALUE) }));
Cache cache = createCacheInstanceForTests();
RetrieveFromCacheService service = createServiceForTests();
service.setExceptionIfNotFound(true);
try {
service.setConnection(new CacheConnection(cache));
start(service);
service.doService(msg);
fail();
} catch (ServiceException expected) {
} finally {
stop(service);
}
}
Aggregations