Search in sources :

Example 1 with StaticSubstitution

use of com.nextdoor.bender.operation.substitution.ztatic.StaticSubstitution in project bender by Nextdoor.

the class StaticSubstitutionTest method testStaticField.

@Test
public void testStaticField() throws FieldNotFoundException {
    ArrayList<Substitution> substitutions = new ArrayList<Substitution>();
    substitutions.add(new StaticSubstitution("foo", "1234", true));
    DummpyMapEvent devent = new DummpyMapEvent();
    InternalEvent ievent = new InternalEvent("", null, 0);
    ievent.setEventObj(devent);
    SubstitutionOperation op = new SubstitutionOperation(substitutions);
    op.perform(ievent);
    assertEquals("1234", devent.getField("foo"));
}
Also used : StaticSubstitution(com.nextdoor.bender.operation.substitution.ztatic.StaticSubstitution) ArrayList(java.util.ArrayList) StaticSubstitution(com.nextdoor.bender.operation.substitution.ztatic.StaticSubstitution) DummpyMapEvent(com.nextdoor.bender.testutils.DummyDeserializerHelper.DummpyMapEvent) InternalEvent(com.nextdoor.bender.InternalEvent) Test(org.junit.Test)

Aggregations

InternalEvent (com.nextdoor.bender.InternalEvent)1 StaticSubstitution (com.nextdoor.bender.operation.substitution.ztatic.StaticSubstitution)1 DummpyMapEvent (com.nextdoor.bender.testutils.DummyDeserializerHelper.DummpyMapEvent)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1