use of net.opengis.sos.x20.InsertObservationType.Observation in project arctic-sea by 52North.
the class InsertObservationRequestEncoderTest method shouldEncodeInsertObservationRequest.
@Test
public void shouldEncodeInsertObservationRequest() throws EncodingException, InvalidSridException, ParseException, DecodingException {
InsertObservationRequest request = createInsertObservationRequest();
XmlObject encodedRequest = encoder.create(request);
XmlHelper.validateDocument(encodedRequest);
Assert.assertThat(encodedRequest, Matchers.notNullValue());
Assert.assertThat(encodedRequest, Matchers.instanceOf(InsertObservationDocument.class));
InsertObservationType insertObservation = ((InsertObservationDocument) encodedRequest).getInsertObservation();
Assert.assertThat(insertObservation.getOfferingArray(), Matchers.notNullValue());
Assert.assertThat(insertObservation.getOfferingArray().length, Is.is(1));
Assert.assertThat(insertObservation.getOfferingArray(0), Is.is(OFFERING_ID));
Assert.assertThat(insertObservation.getObservationArray(), Matchers.notNullValue());
Assert.assertThat(insertObservation.getObservationArray().length, Is.is(1));
// no check for observation values, because that MUST be part of OmEncoderv20Test
}
use of net.opengis.sos.x20.InsertObservationType.Observation in project arctic-sea by 52North.
the class InsertSensorRequestEncoderTest method shouldEncodeSosInsertionMetadata.
@Test
public void shouldEncodeSosInsertionMetadata() throws EncodingException {
InsertSensorDocument isd = (InsertSensorDocument) encoder.create(request);
Assert.assertThat(isd.getInsertSensor().getMetadataArray().length, Is.is(1));
Assert.assertThat(isd.getInsertSensor().getMetadataArray(0).getInsertionMetadata(), CoreMatchers.instanceOf(SosInsertionMetadataType.class));
SosInsertionMetadataType insertionMetadata = (SosInsertionMetadataType) isd.getInsertSensor().getMetadataArray(0).getInsertionMetadata();
Assert.assertThat(insertionMetadata.getFeatureOfInterestTypeArray(), CoreMatchers.notNullValue());
List<String> foiTypes = Arrays.asList(insertionMetadata.getFeatureOfInterestTypeArray());
Assert.assertThat(foiTypes, Matchers.hasSize(2));
Assert.assertThat(foiTypes, Matchers.containsInAnyOrder("test-foi-type-1", "test-foi-type-2"));
Assert.assertThat(insertionMetadata.getObservationTypeArray(), CoreMatchers.notNullValue());
List<String> oTypes = Arrays.asList(insertionMetadata.getObservationTypeArray());
Assert.assertThat(oTypes, Matchers.hasSize(2));
Assert.assertThat(oTypes, Matchers.containsInAnyOrder("test-observation-type-1", "test-observation-type-2"));
}
Aggregations