@Test
public void buildInsertObservation_should_add_feature_instance() throws OXFException, XmlException {

    addServiceAndVersion();
    addObservationValues();
    addNewFoiValues();
    String insertObservation = builder.buildInsertObservationRequest(parameters);
    SFSpatialSamplingFeatureType feature =
            SFSpatialSamplingFeatureDocument.Factory.parse(
                    InsertObservationDocument.Factory.parse(insertObservation)
            .getInsertObservation()
            .getObservationArray(0)
            .getOMObservation()
            .getFeatureOfInterest()
            .xmlText())
            .getSFSpatialSamplingFeature();
    assertThat(feature.getId(), not(isEmptyOrNullString()));
    assertThat(feature.getIdentifier().getStringValue(), is(foiId));
    assertThat(feature.getNameArray(0).getStringValue(), is(newFoiName));
    assertThat(feature.getType().getHref(), is(OGC_OM_2_0_SF_SAMPLING_POINT));
    assertThat(feature.getSampledFeature().getHref(), is(newFoiParentFeatureId));
    assertThat(((PointType)feature.getShape().getAbstractGeometry()).getPos().getSrsName(),
            is("http://www.opengis.net/def/crs/EPSG/0/4326"));
    final DirectPositionType pos = ((PointType)feature.getShape().getAbstractGeometry()).getPos();
    assertThat(pos.getSrsName(), endsWith(newFoiEpsgCode));
    assertThat(pos.getSrsName(), startsWith(OGC_URI_START_CRS));
    assertThat(pos.getStringValue(), is(newFoiPositionString));
    /*
     * 2nd to test if parent feature id is set correct if not given
     */
    parameters.removeParameterShell(INSERT_OBSERVATION_NEW_FOI_PARENT_FEATURE_ID);
    insertObservation = builder.buildInsertObservationRequest(parameters);
    feature = SFSpatialSamplingFeatureDocument.Factory.parse(
            InsertObservationDocument.Factory.parse(insertObservation)
            .getInsertObservation()
            .getObservationArray(0)
            .getOMObservation()
            .getFeatureOfInterest()
            .xmlText())
            .getSFSpatialSamplingFeature();
    assertThat(feature.getSampledFeature().getHref(),is(OGC_UNKNOWN_VALUE));
}