use of com.adaptris.core.metadata.NoOpMetadataFilter in project interlok by adaptris.
the class MetadataConverterCase method testMetadataFilter.
@Test
public void testMetadataFilter() throws Exception {
MetadataConverter mc = createConverter();
assertTrue(mc.getMetadataFilter() instanceof NoOpMetadataFilter);
mc.setMetadataFilter(new RegexMetadataFilter());
assertTrue(mc.getMetadataFilter() instanceof RegexMetadataFilter);
}
use of com.adaptris.core.metadata.NoOpMetadataFilter in project interlok by adaptris.
the class MessageTypeTranslatorCase method testRoundTrip.
@Test
public void testRoundTrip() throws Exception {
MessageTypeTranslatorImp translator = createTranslator().withMoveJmsHeaders(true).withMetadataFilter(new NoOpMetadataFilter()).withReportAllErrors(true);
StandaloneProducer p1 = createProducer(translator);
StandaloneProducer p2 = roundTrip(p1);
BaseCase.assertRoundtripEquality(p1, p2);
}
use of com.adaptris.core.metadata.NoOpMetadataFilter in project interlok by adaptris.
the class MimeAggregatorCase method testJoinMessage_PartHeaderFilter.
@Test
public void testJoinMessage_PartHeaderFilter() throws Exception {
MimeAggregator aggr = createAggregatorForTests().withPartHeaderFilter(new NoOpMetadataFilter());
AdaptrisMessage original = AdaptrisMessageFactory.getDefaultInstance().newMessage("<envelope/>", null, new HashSet<>(Arrays.asList(new MetadataElement("X-Interlok-Test", "ZZLC-original"))));
AdaptrisMessage s1 = AdaptrisMessageFactory.getDefaultInstance().newMessage("<document>hello</document>", null, new HashSet<>(Arrays.asList(new MetadataElement("X-Interlok-Test", "ZZLC-split1"))));
AdaptrisMessage s2 = AdaptrisMessageFactory.getDefaultInstance().newMessage("<document>world</document>", null, new HashSet<>(Arrays.asList(new MetadataElement("X-Interlok-Test", "ZZLC-split2"))));
aggr.joinMessage(original, Arrays.asList(s1, s2));
String payload = original.getContent();
assertTrue(payload.contains("ZZLC-split1"));
assertTrue(payload.contains("ZZLC-split2"));
}
use of com.adaptris.core.metadata.NoOpMetadataFilter in project interlok by adaptris.
the class MimeAggregatorCase method testJoinMessage_MimeHeaderFilter.
@Test
public void testJoinMessage_MimeHeaderFilter() throws Exception {
MimeAggregator aggr = createAggregatorForTests().withMimeHeaderFilter(new NoOpMetadataFilter());
AdaptrisMessage original = AdaptrisMessageFactory.getDefaultInstance().newMessage("<envelope/>", null, new HashSet<>(Arrays.asList(new MetadataElement("X-Interlok-Test", "ZZLC-original"))));
AdaptrisMessage s1 = AdaptrisMessageFactory.getDefaultInstance().newMessage("<document>hello</document>", null, new HashSet<>(Arrays.asList(new MetadataElement("X-Interlok-Test", "ZZLC-split1"))));
AdaptrisMessage s2 = AdaptrisMessageFactory.getDefaultInstance().newMessage("<document>world</document>", null, new HashSet<>(Arrays.asList(new MetadataElement("X-Interlok-Test", "ZZLC-split2"))));
aggr.joinMessage(original, Arrays.asList(s1, s2));
String payload = original.getContent();
assertTrue(payload.contains("ZZLC-original"));
assertFalse(payload.contains("ZZLC-split1"));
assertFalse(payload.contains("ZZLC-split2"));
}
use of com.adaptris.core.metadata.NoOpMetadataFilter in project interlok by adaptris.
the class MetadataRequestHeadersTest method testFilter.
@Test
public void testFilter() throws Exception {
MetadataRequestHeaders headers = new MetadataRequestHeaders();
assertNull(headers.getFilter());
headers.setFilter(new NoOpMetadataFilter());
assertEquals(NoOpMetadataFilter.class, headers.getFilter().getClass());
try {
headers.setFilter(null);
fail();
} catch (IllegalArgumentException expected) {
}
assertEquals(NoOpMetadataFilter.class, headers.getFilter().getClass());
}
Aggregations