use of com.adaptris.util.text.mime.SelectByPosition in project interlok by adaptris.
the class DynamicServiceExecutorTest method testDoService_MimeServiceExtractor_ByPosition.
@Test
public void testDoService_MimeServiceExtractor_ByPosition() throws Exception {
AddMetadataService metadataService = new AddMetadataService();
metadataService.addMetadataElement(new MetadataElement(getName(), getName()));
DynamicServiceExecutor dynamicService = createService();
dynamicService.setServiceExtractor(new MimeServiceExtractor(new SelectByPosition(0)));
AdaptrisMessage msg = createMimeMessage(new ServiceList(new Service[] { metadataService }), ENCODING_7BIT);
execute(dynamicService, msg);
assertEquals(getName(), msg.getMetadataValue(getName()));
}
Aggregations