@Test public void testCreateNewTask() { SensorTask newTask = sensorTaskRepository.createNewSensorTask(PROCEDURE_1); assertEquals("Different procedure id of new task.", PROCEDURE_1, newTask.getProcedure()); assertAmountOfCreatedTasksAvailable(sensorTaskRepository, PROCEDURE_1, 1); }
public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sensorTasks.put(sensorTaskKey, sensorTask); return sensorTask; }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sensorTasks.put(sensorTaskKey, sensorTask); return sensorTask; } }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sensorTasks.put(sensorTaskKey, sensorTask); return sensorTask; }  }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sensorTasks.put(sensorTaskKey, sensorTask); return sensorTask; }  SensorTask createNewSensorTask(String procedure); void saveOrUpdateSensorTask(SensorTask sensorTask); void removeSensorTask(SensorTask sensorTask); boolean containsSensorTask(String procedure, String taskId); SensorTask getTask(String taskId); Iterable<String> getSensorTaskIds(String procedure); Iterable<SensorTask> getSensorTasks(String procedure); SensorTask getSensorTask(String procedure, String taskId); IdWithPrefixGenerator getIdGenerator(); long getTaskAmountOf(String procedure); }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sensorTasks.put(sensorTaskKey, sensorTask); return sensorTask; }  SensorTask createNewSensorTask(String procedure); void saveOrUpdateSensorTask(SensorTask sensorTask); void removeSensorTask(SensorTask sensorTask); boolean containsSensorTask(String procedure, String taskId); SensorTask getTask(String taskId); Iterable<String> getSensorTaskIds(String procedure); Iterable<SensorTask> getSensorTasks(String procedure); SensorTask getSensorTask(String procedure, String taskId); IdWithPrefixGenerator getIdGenerator(); long getTaskAmountOf(String procedure);  }