ReactiveTrigger { String oldJson() { if (INSERT.equals(triggerEvent)) { return "'{}'"; } else { return generateConcatStatement("OLD", tableColumns); } } ReactiveTrigger(String triggerName, String triggerTable, TriggerEvent triggerEvent, TriggerTime triggerTime,
                    List<String> tableColumns); String getDropSql();  }
@Test(groups = SMALL) public void testCreatesTheCorrectJsonForOldEntityForDelete() { ReactiveTrigger reactiveTrigger = new ReactiveTrigger(TRIGGER_NAME, TRIGGER_TABLE, DELETE, AFTER, TABLE_COLS); assertEquals(reactiveTrigger.oldJson(), "CONCAT('{'," + "'\\\"ID\\\":','\\\"',OLD.ID,'\\\"',','," + "'\\\"TXT\\\":','\\\"',OLD.TXT,'\\\"'," + "'}')"); }
@Test(groups = SMALL) public void testCreatesTheCorrectJsonForOldEntityForUpdate() { ReactiveTrigger reactiveTrigger = new ReactiveTrigger(TRIGGER_NAME, TRIGGER_TABLE, UPDATE, AFTER, TABLE_COLS); assertEquals(reactiveTrigger.oldJson(), "CONCAT('{'," + "'\\\"ID\\\":','\\\"',OLD.ID,'\\\"',','," + "'\\\"TXT\\\":','\\\"',OLD.TXT,'\\\"'," + "'}')"); }
@Test(groups = SMALL) public void testCreatesEmptyOldEntityJsonForInsert() { ReactiveTrigger reactiveTrigger = new ReactiveTrigger(TRIGGER_NAME, TRIGGER_TABLE, INSERT, AFTER, TABLE_COLS); assertEquals(reactiveTrigger.oldJson(), "'{}'"); }