use of org.n52.shetland.ogc.sos.request.InsertSensorRequest in project arctic-sea by 52North.
the class InsertSensorRequestEncoderTest method prepare.
@Before
public void prepare() {
request = new InsertSensorRequest("service", "version");
request.setProcedureDescriptionFormat(SensorML20Constants.SENSORML_20_OUTPUT_FORMAT_URL);
request.setProcedureDescription(createProcedureDescription());
SosInsertionMetadata metadata = new SosInsertionMetadata();
metadata.setFeatureOfInterestTypes(CollectionHelper.list("test-foi-type-1", "test-foi-type-2"));
metadata.setObservationTypes(CollectionHelper.list("test-observation-type-1", "test-observation-type-2"));
request.setMetadata(metadata);
request.setObservableProperty(CollectionHelper.list("test-property-1", "test-property-2"));
encoder = new InsertSensorRequestEncoder();
encoder.setXmlOptions(() -> new XmlOptions());
SensorMLEncoderv20 sensorMLEncoderv20 = new SensorMLEncoderv20();
sensorMLEncoderv20.setXmlOptions(() -> new XmlOptions());
GmlEncoderv321 gmlEncoder = new GmlEncoderv321();
gmlEncoder.setXmlOptions(() -> new XmlOptions());
SosInsertionMetadataTypeEncoder metadataEncoder = new SosInsertionMetadataTypeEncoder();
metadataEncoder.setXmlOptions(() -> new XmlOptions());
EncoderRepository encoderRepository = new EncoderRepository();
encoderRepository.setEncoders(Arrays.asList(encoder, sensorMLEncoderv20, gmlEncoder, metadataEncoder));
encoderRepository.init();
encoder.setEncoderRepository(encoderRepository);
sensorMLEncoderv20.setEncoderRepository(encoderRepository);
gmlEncoder.setEncoderRepository(encoderRepository);
metadataEncoder.setEncoderRepository(encoderRepository);
}
use of org.n52.shetland.ogc.sos.request.InsertSensorRequest in project arctic-sea by 52North.
the class InsertSensorRequestEncoderTest method shouldThrowExceptionIfVersionIsMissing.
@Test
public void shouldThrowExceptionIfVersionIsMissing() throws EncodingException {
thrown.expect(UnsupportedEncoderInputException.class);
thrown.expectMessage(Is.is("Encoder " + InsertSensorRequestEncoder.class.getSimpleName() + " can not encode 'missing version'"));
encoder.create(new InsertSensorRequest("service", ""));
}
use of org.n52.shetland.ogc.sos.request.InsertSensorRequest in project arctic-sea by 52North.
the class InsertSensorRequestEncoderTest method shouldThrowExceptionWhenProcedureDescriptionFormatIsMissing.
@Test
public void shouldThrowExceptionWhenProcedureDescriptionFormatIsMissing() throws EncodingException {
thrown.expect(UnsupportedEncoderInputException.class);
thrown.expectMessage(Is.is("Encoder " + InsertSensorRequestEncoder.class.getSimpleName() + " can not encode 'procedure description format missing'"));
encoder.create(new InsertSensorRequest("service", "version"));
}
use of org.n52.shetland.ogc.sos.request.InsertSensorRequest in project arctic-sea by 52North.
the class InsertSensorRequestEncoderTest method shouldThrowExceptionIfServiceIsMissing.
@Test
public void shouldThrowExceptionIfServiceIsMissing() throws EncodingException {
thrown.expect(UnsupportedEncoderInputException.class);
thrown.expectMessage(Is.is("Encoder " + InsertSensorRequestEncoder.class.getSimpleName() + " can not encode 'missing service'"));
encoder.create(new InsertSensorRequest());
}
use of org.n52.shetland.ogc.sos.request.InsertSensorRequest in project arctic-sea by 52North.
the class InsertSensorRequestEncoderTest method shouldThrowExceptionWhenObservablePropertyIsMissing.
@Test
public void shouldThrowExceptionWhenObservablePropertyIsMissing() throws EncodingException {
thrown.expect(UnsupportedEncoderInputException.class);
thrown.expectMessage(Is.is("Encoder " + InsertSensorRequestEncoder.class.getSimpleName() + " can not encode 'observed property missing'"));
InsertSensorRequest request = new InsertSensorRequest("service", "version");
request.setProcedureDescriptionFormat("test-format");
request.setProcedureDescription(createProcedureDescription());
encoder.create(request);
}
Aggregations