@Test(groups = SMALL) public void testGetCreateSqlContainsBothOldAndNewColumnValuesForUpdate() { ReactiveTrigger trigger = new ReactiveTrigger(TRIGGER_NAME, TRIGGER_TABLE, UPDATE, AFTER, TABLE_COLS); String triggerSql = trigger.getCreateSql(); assertTrue(triggerSql.contains("NEW.ID")); assertTrue(triggerSql.contains("NEW.TXT")); assertTrue(triggerSql.contains("OLD.ID")); assertTrue(triggerSql.contains("OLD.TXT")); }
String getCreateSql() { String triggerSql = format(CREATE_TRIGGER_TEMPLATE, triggerName, triggerTime, triggerEvent, triggerTable); String mainBody = MAIN_BODY_TEMPLATE .replace("{oldJson}", oldJson()) .replace("{newJson}", newJson()) .replace("{tableName}", triggerTable) .replace("{eventType}", triggerEvent.toString()); return triggerSql.replace("{mainBody}", mainBody); }
ReactiveTrigger { String getCreateSql() { String triggerSql = format(CREATE_TRIGGER_TEMPLATE, triggerName, triggerTime, triggerEvent, triggerTable); String mainBody = MAIN_BODY_TEMPLATE .replace("{oldJson}", oldJson()) .replace("{newJson}", newJson()) .replace("{tableName}", triggerTable) .replace("{eventType}", triggerEvent.toString()); return triggerSql.replace("{mainBody}", mainBody); } }
ReactiveTrigger { String getCreateSql() { String triggerSql = format(CREATE_TRIGGER_TEMPLATE, triggerName, triggerTime, triggerEvent, triggerTable); String mainBody = MAIN_BODY_TEMPLATE .replace("{oldJson}", oldJson()) .replace("{newJson}", newJson()) .replace("{tableName}", triggerTable) .replace("{eventType}", triggerEvent.toString()); return triggerSql.replace("{mainBody}", mainBody); } ReactiveTrigger(String triggerName, String triggerTable, TriggerEvent triggerEvent, TriggerTime triggerTime,
                    List<String> tableColumns); }
ReactiveTrigger { String getCreateSql() { String triggerSql = format(CREATE_TRIGGER_TEMPLATE, triggerName, triggerTime, triggerEvent, triggerTable); String mainBody = MAIN_BODY_TEMPLATE .replace("{oldJson}", oldJson()) .replace("{newJson}", newJson()) .replace("{tableName}", triggerTable) .replace("{eventType}", triggerEvent.toString()); return triggerSql.replace("{mainBody}", mainBody); } ReactiveTrigger(String triggerName, String triggerTable, TriggerEvent triggerEvent, TriggerTime triggerTime,
                    List<String> tableColumns); String getDropSql(); }
ReactiveTrigger { String getCreateSql() { String triggerSql = format(CREATE_TRIGGER_TEMPLATE, triggerName, triggerTime, triggerEvent, triggerTable); String mainBody = MAIN_BODY_TEMPLATE .replace("{oldJson}", oldJson()) .replace("{newJson}", newJson()) .replace("{tableName}", triggerTable) .replace("{eventType}", triggerEvent.toString()); return triggerSql.replace("{mainBody}", mainBody); } ReactiveTrigger(String triggerName, String triggerTable, TriggerEvent triggerEvent, TriggerTime triggerTime,
                    List<String> tableColumns); String getDropSql();  }