use of org.n52.svalbard.encode.exception.EncoderResponseUnsupportedException in project arctic-sea by 52North.
the class OwsExceptionReportEncoderTest method testExceptionWithoutCause.
@Test
public void testExceptionWithoutCause() throws JSONEncodingException {
final EncoderResponseUnsupportedException owse = new EncoderResponseUnsupportedException();
owse.setVersion("2.0.0");
final JsonNode json = enc.encodeJSON(owse);
assertThat(json, is(notNullValue()));
final String message = "The encoder response is not supported!";
e.checkThat(json, is(instanceOf(SchemaConstants.Common.EXCEPTION_REPORT)));
e.checkThat(json.path(VERSION).asText(), is(equalTo("2.0.0")));
e.checkThat(json.path(EXCEPTIONS), is(arrayOfLength(1)));
e.checkThat(json.path(EXCEPTIONS).path(0), isObject());
e.checkThat(json.path(EXCEPTIONS).path(0).path(LOCATOR), does(not(exist())));
e.checkThat(json.path(EXCEPTIONS).path(0).path(TEXT).asText(), is(equalTo(message)));
}
Aggregations