Make ListenerAdapter serialize JSON directly
[netconf.git] / restconf / restconf-nb-rfc8040 / src / test / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / errors / RestconfDocumentedExceptionMapperTest.java
index dd4ab693dbacea8eff428098217d5d7335b82156..c555b9297884abfed9cb0847022c3caaba5f059e 100644 (file)
@@ -19,6 +19,7 @@ import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
+import org.json.JSONException;
 import org.json.JSONObject;
 import org.json.XML;
 import org.junit.Assert;
@@ -288,7 +289,7 @@ public class RestconfDocumentedExceptionMapperTest {
     public Response expectedResponse;
 
     @Test
-    public void testMappingOfExceptionToResponse() {
+    public void testMappingOfExceptionToResponse() throws JSONException {
         exceptionMapper.setHttpHeaders(httpHeaders);
         final Response response = exceptionMapper.toResponse(thrownException);
         compareResponseWithExpectation(expectedResponse, response);
@@ -301,7 +302,8 @@ public class RestconfDocumentedExceptionMapperTest {
         return httpHeaders;
     }
 
-    private static void compareResponseWithExpectation(final Response expectedResponse, final Response actualResponse) {
+    private static void compareResponseWithExpectation(final Response expectedResponse, final Response actualResponse)
+            throws JSONException {
         final String errorMessage = String.format("Actual response %s doesn't equal to expected response %s",
                 actualResponse, expectedResponse);
         Assert.assertEquals(errorMessage, expectedResponse.getStatus(), actualResponse.getStatus());