@@ -0,0 +1,1384 @@
+package com.coding4people.mosquitoreport.api.exceptionmappers;%0D%0A%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0A%0D%0Aimport javax.ws.rs.client.Entity;%0D%0Aimport javax.ws.rs.core.Response;%0D%0A%0D%0Aimport org.glassfish.jersey.server.ResourceConfig;%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport com.coding4people.mosquitoreport.api.WithServer;%0D%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0D%0Aimport com.fasterxml.jackson.databind.node.ObjectNode;%0D%0A%0D%0Apublic class JsonMappingExceptionMapperTest extends WithServer %7B%0D%0A%0D%0A    @Override%0D%0A    protected ResourceConfig configure() %7B%0D%0A        return super.configure().register(ExceptionMapperTestController.class)%0D%0A                .register(JsonMappingExceptionMapper.class);%0D%0A    %7D%0D%0A%0D%0A    @Test%0D%0A    public void testExtraParameter() %7B%0D%0A        ObjectNode input = new ObjectMapper().createObjectNode();%0D%0A        input.put(%22token%22, %22...%22);%0D%0A        input.put(%22extra_paramenter%22, %22...%22);%0D%0A%0D%0A        Response response = target().path(%22/%22).request().post(Entity.json(input));%0D%0A%0D%0A        assertEquals(400, response.getStatus());%0D%0A        assertEquals(%22application/json;charset=UTF-8%22, response.getHeaderString(%22Content-type%22));%0D%0A%0D%0A        ObjectNode ObjectNode = response.readEntity(ObjectNode.class);%0D%0A%0D%0A        assertEquals(%22error%22, ObjectNode.get(%22status%22).asText());%0D%0A        assertEquals(%22Error mapping json%22, ObjectNode.get(%22message%22).asText());%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

Test JsonMappingExceptionMapper