Assert.assertTrue(API.getMacros().getMacroById(macro.getId()).getMacro().getId() > 0);
}
@Test
public void testCreateUpdateApplyAndDeleteMacro() throws Exception {
Macro macro = new Macro();
macro.setTitle("Test Macro 1");
List<Action> actions = new ArrayList<Action>();
Action action = new Action();
action.setField("status");
action.setValue("open");
actions.add(action);
macro.setActions(actions);
// Create
Macro responseMacro = API.getMacros().createMacro(macro).getMacro();
Assert.assertTrue(responseMacro.getId() > 0);
// Update
responseMacro.setTitle("Test Macro 2");
Macro updateMacro = API.getMacros().updateMacro(responseMacro).getMacro();
Assert.assertEquals(updateMacro.getId(), responseMacro.getId());
// Apply
Ticket ticket = new Ticket();
ticket.setSubject("Macro test ticket");
ticket.setDescription("Testing macros");