@Test public void testList() { String mess = "list"; String expResult = "Allowed"; String result = msg.manageMessage(mess); assertTrue(result.startsWith(expResult)); }
private String list(String[] tokenMess) { if (tokenMess.length>1 && tokenMess[1].equals(TRIGGER)){ String res = "? \n"; for (Trigger t : api.triggers().findAll()){ res+= t.getName() + "\n"; } return res; } return "Allowed tokens: trigger"; }
MessageService { private String list(String[] tokenMess) { if (tokenMess.length>1 && tokenMess[1].equals(TRIGGER)){ String res = "? \n"; for (Trigger t : api.triggers().findAll()){ res+= t.getName() + "\n"; } return res; } return "Allowed tokens: trigger"; } }
MessageService { private String list(String[] tokenMess) { if (tokenMess.length>1 && tokenMess[1].equals(TRIGGER)){ String res = "? \n"; for (Trigger t : api.triggers().findAll()){ res+= t.getName() + "\n"; } return res; } return "Allowed tokens: trigger"; } @Inject  MessageService(NlpCommand nlpCommands, API api); }
MessageService { private String list(String[] tokenMess) { if (tokenMess.length>1 && tokenMess[1].equals(TRIGGER)){ String res = "? \n"; for (Trigger t : api.triggers().findAll()){ res+= t.getName() + "\n"; } return res; } return "Allowed tokens: trigger"; } @Inject  MessageService(NlpCommand nlpCommands, API api); String manageMessage(String mess); }
MessageService { private String list(String[] tokenMess) { if (tokenMess.length>1 && tokenMess[1].equals(TRIGGER)){ String res = "? \n"; for (Trigger t : api.triggers().findAll()){ res+= t.getName() + "\n"; } return res; } return "Allowed tokens: trigger"; } @Inject  MessageService(NlpCommand nlpCommands, API api); String manageMessage(String mess); static String IF; static String THEN; static String WHEN; static String HELP; static String LIST; static String TRIGGER; }