### Question:
JpaStorage implements Storage { @Override public final Sensor getSensor(final String sensorName) { return (Sensor) persistenceManager.pick("select s from Sensor s where s.name = ?1", sensorName); } JpaStorage(PersistenceManager persistenceManager); @Override DataFile getDatafile(int id); @Override final DataFile getDatafile(final String path); @Override DataFile getDatafileWithTransaction(String path); void store(DataFile dataFile); @Override int storeWithTransaction(DataFile dataFile); @Override Observation getObservation(int id); @Override RelatedObservation getRelatedObservation(int id); @Override ReferenceObservation getReferenceObservation(int id); @Override final Sensor getSensor(final String sensorName); @Override Sensor getSensorWithTransaction(String sensorName); @Override void storeWithTransaction(Sensor sensor); @Override List<RelatedObservation> getRelatedObservations(String sensorName, Date startDate, Date stopDate); @Override void store(InsituObservation insituObservation);  }### Answer:
@Test public void testGetSensor() { final String sql = "select s from Sensor s where s.name = ?1"; final String sensorName = "blabla"; final Sensor sensor = new SensorBuilder().name(sensorName).build(); when(persistenceManager.pick(sql, sensorName)).thenReturn(sensor); final Sensor toolStorageSensor = jpaStorage.getSensor(sensorName); assertNotNull(toolStorageSensor); assertEquals(sensorName, toolStorageSensor.getName()); verify(persistenceManager, times(1)).pick(sql, sensorName); verifyNoMoreInteractions(persistenceManager); }