@Test public void testAddToTaskDefinition() { TaskDefinition taskDefinition = new TaskDefinition(); taskDefinition.setDescription(DESCRIPTION); taskDefinition.setName(NAME); this.taskDescriptor.addTaskDefinition(taskDefinition); assertNotNull(this.taskDescriptor.getTaskDefinition()); assertTrue(taskDefinition.getTaskDescriptors().size() == 1); }
@Test public void testRemoveFromTaskDefinition() { TaskDefinition taskDefinition = new TaskDefinition(); taskDefinition.setDescription(DESCRIPTION); taskDefinition.setName(NAME); this.taskDescriptor.addTaskDefinition(taskDefinition); assertNotNull("null", this.taskDescriptor.getTaskDefinition()); assertTrue("empty", taskDefinition.getTaskDescriptors().size() == 1); this.taskDescriptor.removeTaskDefinition(taskDefinition); assertNull("null", this.taskDescriptor.getTaskDefinition()); assertTrue("empty", taskDefinition.getTaskDescriptors().isEmpty()); }