use of com.adaptris.util.text.mime.SelectByContentId in project interlok by adaptris.
the class DynamicServiceExecutorTest method testDoService_MimeServiceExtractor_ByContentId_NotFound.
@Test
public void testDoService_MimeServiceExtractor_ByContentId_NotFound() throws Exception {
AddMetadataService metadataService = new AddMetadataService();
metadataService.addMetadataElement(new MetadataElement(getName(), getName()));
DynamicServiceExecutor dynamicService = createService();
dynamicService.setServiceExtractor(new MimeServiceExtractor(new SelectByContentId("Blah")));
AdaptrisMessage msg = createMimeMessage(new ServiceList(new Service[] { metadataService }), ENCODING_BASE64);
try {
execute(dynamicService, msg);
fail();
} catch (ServiceException expected) {
}
}
use of com.adaptris.util.text.mime.SelectByContentId in project interlok by adaptris.
the class DynamicServiceExecutorTest method testDoService_MimeServiceExtractor_ByContentId.
@Test
public void testDoService_MimeServiceExtractor_ByContentId() throws Exception {
AddMetadataService metadataService = new AddMetadataService();
metadataService.addMetadataElement(new MetadataElement(getName(), getName()));
DynamicServiceExecutor dynamicService = createService();
dynamicService.setServiceExtractor(new MimeServiceExtractor(new SelectByContentId("Service")));
AdaptrisMessage msg = createMimeMessage(new ServiceList(new Service[] { metadataService }), ENCODING_8BIT);
execute(dynamicService, msg);
assertEquals(getName(), msg.getMetadataValue(getName()));
}
Aggregations