Search in sources :

Example 1 with EncoderResponseUnsupportedException

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)));
}
Also used : EncoderResponseUnsupportedException(org.n52.svalbard.encode.exception.EncoderResponseUnsupportedException) JsonNode(com.fasterxml.jackson.databind.JsonNode) Test(org.junit.Test)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 Test (org.junit.Test)1 EncoderResponseUnsupportedException (org.n52.svalbard.encode.exception.EncoderResponseUnsupportedException)1