use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class DiscardEmptyValuesFilterTest method testFilterCollection.
@Test
public void testFilterCollection() throws Exception {
DiscardEmptyValuesFilter filter = new DiscardEmptyValuesFilter();
MetadataCollection c = filter.filter(new MetadataCollection(createMessage().getMetadata()));
assertEquals(3, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class DiscardEmptyValuesFilterTest method testFilterMessage.
@Test
public void testFilterMessage() throws Exception {
DiscardEmptyValuesFilter filter = new DiscardEmptyValuesFilter();
MetadataCollection c = filter.filter(createMessage());
assertEquals(3, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class DiscardValuesTooLongFilterTest method testFilterSet.
@Test
public void testFilterSet() throws Exception {
DiscardValuesTooLongFilter filter = new DiscardValuesTooLongFilter(36);
MetadataCollection c = filter.filter(createMessage().getMetadata());
assertEquals(4, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class DiscardValuesTooLongFilterTest method testFilterMessage.
@Test
public void testFilterMessage() throws Exception {
DiscardValuesTooLongFilter filter = new DiscardValuesTooLongFilter(36);
MetadataCollection c = filter.filter(createMessage());
assertEquals(4, c.size());
}
use of com.adaptris.core.MetadataCollection in project interlok by adaptris.
the class OrderedItemMetadataFilterTest method testFilter.
@Test
public void testFilter() {
OrderedItemMetadataFilter filter = new OrderedItemMetadataFilter();
filter.setMetadataKeys(Arrays.asList("key1", "key2", "key3"));
AdaptrisMessage message = AdaptrisMessageFactory.getDefaultInstance().newMessage();
message.addMetadata("Key1", "value1");
message.addMetadata("key3", "value3");
MetadataCollection collection = filter.filter(message);
assertEquals(3, collection.size());
assertEquals("key1", collection.get(0).getKey());
assertEquals("", collection.get(0).getValue());
assertEquals("key2", collection.get(1).getKey());
assertEquals("", collection.get(1).getValue());
assertEquals("key3", collection.get(2).getKey());
assertEquals("value3", collection.get(2).getValue());
}
Aggregations