@Test public void shouldStoreLastMeasurementForEachSensor() { triggerMeasurement("LHC", 150); triggerMeasurement("LHC2", 123); Sensor sensor2 = mock(Sensor.class); when(sensor2.getSensorName()).thenReturn("LHC2"); assertThat(sessionManager.getNow(sensor), equalTo(150.0)); assertThat(sessionManager.getNow(sensor2), equalTo(123.0)); }
@Test public void shouldAssumeLastMeasurementIsZeroByDefault() { assertThat(sessionManager.getNow(sensor), equalTo(0.0)); }