use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.
the class DescribeSensorResponseEncoderTest method should_add_own_prefix_to_prefixMap.
@Test
public void should_add_own_prefix_to_prefixMap() {
Map<String, String> prefixMap = Maps.newHashMap();
new DescribeSensorResponseEncoder().addNamespacePrefixToMap(prefixMap);
assertThat(prefixMap.isEmpty(), is(FALSE));
assertThat(prefixMap.containsKey(SwesConstants.NS_SWES_20), is(TRUE));
assertThat(prefixMap.containsValue(SwesConstants.NS_SWES_PREFIX), is(TRUE));
}
use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.
the class DescribeSensorResponseEncoderTest method should_return_exception_if_received_null.
@Test(expected = UnsupportedEncoderInputException.class)
public void should_return_exception_if_received_null() throws OwsExceptionReport, EncodingException {
new DescribeSensorResponseEncoder().encode(null);
new DescribeSensorResponseEncoder().encode(null, new ByteArrayOutputStream());
new DescribeSensorResponseEncoder().encode(null, EncodingContext.empty());
}
use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.
the class DescribeSensorResponseEncoderTest method should_return_correct_encoder_keys.
@Test
public void should_return_correct_encoder_keys() {
Set<EncoderKey> returnedKeySet = new DescribeSensorResponseEncoder().getKeys();
assertThat(returnedKeySet.size(), is(3));
assertThat(returnedKeySet, hasItem(new XmlEncoderKey(SwesConstants.NS_SWES_20, DescribeSensorResponse.class)));
assertThat(returnedKeySet, hasItem(new OperationResponseEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, SosConstants.Operations.DescribeSensor, MediaTypes.TEXT_XML)));
assertThat(returnedKeySet, hasItem(new OperationResponseEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, SosConstants.Operations.DescribeSensor, MediaTypes.APPLICATION_XML)));
}
use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.
the class DescribeSensorResponseEncoderTest method should_return_emptySet_for_conformanceClasses.
@Test
public void should_return_emptySet_for_conformanceClasses() {
assertThat(new DescribeSensorResponseEncoder().getConformanceClasses(SosConstants.SOS, Sos2Constants.SERVICEVERSION), is(not(nullValue())));
assertThat(new DescribeSensorResponseEncoder().getConformanceClasses(SosConstants.SOS, Sos2Constants.SERVICEVERSION).isEmpty(), is(TRUE));
}
use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.
the class DescribeSensorResponseEncoderTest method should_return_emptyMap_for_supportedTypes.
@Test
public void should_return_emptyMap_for_supportedTypes() {
assertThat(new DescribeSensorResponseEncoder().getSupportedTypes(), is(not(nullValue())));
assertThat(new DescribeSensorResponseEncoder().getSupportedTypes().isEmpty(), is(TRUE));
}
Aggregations