@Test public void testGetSensorForProcedure() throws InternalServiceException { SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(sensorInstanceProvider); ((SensorInstanceProviderSeam) sensorInstanceProvider).addSensor(testPlugin); assertEquals(sensorInstanceProvider.getSensorForProcedure(testPlugin.getProcedure()), testPlugin); }
public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; }  }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; }  void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(String procedure); SensorPlugin getSensorForProcedure(String procedure); SensorPlugin getSensorForTaskId(String taskId); SensorConfigurationRepository getSensorConfigurationRepository(); void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository); SensorTaskRepository getSensorTaskRepository(); void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository); void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent); }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; }  void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(String procedure); SensorPlugin getSensorForProcedure(String procedure); SensorPlugin getSensorForTaskId(String taskId); SensorConfigurationRepository getSensorConfigurationRepository(); void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository); SensorTaskRepository getSensorTaskRepository(); void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository); void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent);  }