use of com.nextdoor.bender.operation.substitution.field.FieldSubstitution in project bender by Nextdoor.
the class FieldSubstitutionTest method testRemoveField.
@Test
public void testRemoveField() throws FieldNotFoundException {
ArrayList<Substitution> substitutions = new ArrayList<Substitution>();
substitutions.add(new FieldSubstitution("bar", Arrays.asList("foo"), true, true, true));
DummpyMapEvent devent = new DummpyMapEvent();
devent.setField("foo", "1234");
InternalEvent ievent = new InternalEvent("", null, 0);
ievent.setEventObj(devent);
SubstitutionOperation op = new SubstitutionOperation(substitutions);
op.perform(ievent);
assertEquals(1, devent.payload.size());
assertEquals("1234", devent.getField("bar"));
}
Aggregations