use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class MetadataRegexKeyFilterTest method testMultipleIncludes.
@Test
public void testMultipleIncludes() {
filterer.withIncludePatterns("key", "Jill");
MetadataCollection resultingCollection = filterer.filter(message);
assertEquals(7, resultingCollection.size());
assertFalse(resultingCollection.containsKey("someRandomKey"));
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class NoOpMetadataFilterTest method testFilterSet.
@Test
public void testFilterSet() throws Exception {
NoOpMetadataFilter filter = new NoOpMetadataFilter();
MetadataCollection c = filter.filter(createMessage().getMetadata());
assertEquals(8, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class NoOpMetadataFilterTest method testFilterCollection.
@Test
public void testFilterCollection() throws Exception {
NoOpMetadataFilter filter = new NoOpMetadataFilter();
MetadataCollection c = filter.filter(new MetadataCollection(createMessage().getMetadata()));
assertEquals(8, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class NoOpMetadataFilterTest method testFilterMessage.
@Test
public void testFilterMessage() throws Exception {
NoOpMetadataFilter filter = new NoOpMetadataFilter();
MetadataCollection c = filter.filter(createMessage());
assertEquals(8, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class PasswordEncodeMetadatafilterTest method testFilter.
@Test
public void testFilter() throws Exception {
PasswordEncodeMetadataFilter filter = new PasswordEncodeMetadataFilter().withStyle(Password.PORTABLE_PASSWORD).withPatterns("^.*password.*$");
AdaptrisMessage msg = createMessage();
MetadataCollection filtered = filter.filter(msg);
assertEquals(3, filtered.size());
// Changes not reflected in the underlying message.
assertEquals("password1", msg.getMetadataValue("passwordKey1"));
assertEquals("password2", msg.getMetadataValue("passwordKey2"));
assertEquals("value1", msg.getMetadataValue("key1"));
assertPasswords(filtered);
}
Aggregations