use of org.n52.shetland.ogc.swe.SweDataComponentVisitor in project arctic-sea by 52North.
the class SweCommonEncoderv101Test method should_throw_NoApplicableCodeException_with_DataRecord_and_field_with_not_supported_element.
@Test
public void should_throw_NoApplicableCodeException_with_DataRecord_and_field_with_not_supported_element() throws EncodingException {
thrown.expect(EncodingException.class);
thrown.expectMessage("The element type '" + getClass().getName() + "$1' " + "of the received '" + SweField.class.getName() + "' is not supported" + " by this encoder '" + SweCommonEncoderv101.class.getName() + "'.");
sweCommonEncoderv101.encode(new SweDataRecord().addField(new SweField("test", new SweAbstractDataComponent() {
@Override
public SweDataComponentType getDataComponentType() {
return null;
}
@Override
public <T, X extends Throwable> T accept(SweDataComponentVisitor<T, X> visitor) {
return null;
}
@Override
public <X extends Throwable> void accept(VoidSweDataComponentVisitor<X> visitor) {
}
@Override
public SweAbstractDataComponent copy() {
return null;
}
})));
}
Aggregations