use of com.nextdoor.bender.operation.json.key.FlattenOperation in project bender by Nextdoor.
the class FlattenOperationTest method testMutatePayload.
@Test
public void testMutatePayload() throws JsonSyntaxException, IOException, OperationException {
JsonParser parser = new JsonParser();
JsonElement input = parser.parse(getResourceString("flatten_input.json"));
String expectedOutput = getResourceString("flatten_output.json");
DummpyEvent devent = new DummpyEvent();
devent.payload = input.getAsJsonObject();
FlattenOperation operation = new FlattenOperation(".");
InternalEvent ievent = new InternalEvent("", null, 0);
ievent.setEventObj(devent);
operation.perform(ievent);
assertEquals(parser.parse(expectedOutput), input);
}
Aggregations