use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class RemoveAllMetadataFilterTest method testFilterCollection.
@Test
public void testFilterCollection() throws Exception {
RemoveAllMetadataFilter filter = new RemoveAllMetadataFilter();
MetadataCollection c = filter.filter(new MetadataCollection(createMessage().getMetadata()));
assertEquals(0, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class MappedKeyMetadataFilterTest method testFilterNoReplacement.
@Test
public void testFilterNoReplacement() {
MappedKeyMetadataFilter filterer = new MappedKeyMetadataFilter("key", "");
AdaptrisMessage message = newMessage();
MetadataCollection resultingCollection = filterer.filter(message);
assertEquals(message.getMetadata().size(), resultingCollection.size());
assertTrue(message.getMessageHeaders().containsKey("key1"));
assertFalse(resultingCollection.containsKey("key1"));
assertFalse(message.getMessageHeaders().containsKey("1"));
assertTrue(resultingCollection.containsKey("1"));
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class MetadataRegexKeyFilterTest method testMultipleExcludes.
@Test
public void testMultipleExcludes() {
filterer.withExcludePatterns("key", "Jill");
MetadataCollection resultingCollection = filterer.filter(message);
assertEquals(1, resultingCollection.size());
assertTrue(resultingCollection.containsKey("someRandomKey"));
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class MetadataRegexKeyFilterTest method testIncludesOnly2Keys.
@Test
public void testIncludesOnly2Keys() {
filterer.addIncludePattern("Jill");
MetadataCollection resultingCollection = filterer.filter(message);
assertEquals(2, resultingCollection.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class MetadataRegexKeyFilterTest method testIncludesOnly1.
@Test
public void testIncludesOnly1() {
filterer.addIncludePattern("key1");
MetadataCollection resultingCollection = filterer.filter(message);
assertEquals(1, resultingCollection.size());
}
Aggregations