@Test
public void testCreateInsituObservation() {

    final SamplingPoint samplingPoint = new SamplingPoint();
    samplingPoint.setDatasetName("ds_name");
    samplingPoint.setIndex(45);
    samplingPoint.setLon(33.89);
    samplingPoint.setLat(-11.88);
    samplingPoint.setTime(889834759837L);
    samplingPoint.setReferenceTime(889835759837L);
    final DataFile dataFile = new DataFile();
    final InsituObservation observation = MatchupGenerator.createInsituObservation(samplingPoint, dataFile);
    assertNotNull(observation);
    assertEquals(samplingPoint.getDatasetName(), observation.getName());
    assertSame(dataFile, observation.getDatafile());
    assertEquals(samplingPoint.getIndex(), observation.getRecordNo());
    assertEquals(Constants.SENSOR_NAME_HISTORY, observation.getSensor());
    final PGgeometry location = observation.getLocation();
    assertNotNull(location);
    final Geometry geometry = location.getGeometry();
    final Point firstPoint = geometry.getFirstPoint();
    assertEquals(samplingPoint.getLat(), firstPoint.getY(), 1e-8);
    assertEquals(samplingPoint.getLon(), firstPoint.getX(), 1e-8);
    assertEquals(samplingPoint.getTime(), observation.getTime().getTime());
    assertEquals(1000.0, observation.getTimeRadius(), 1e-8);
}