### Question:
ApiExceptionMapper implements ExceptionMapper<ApiException> { @Override public Response toResponse(ApiException exception) { logger.error("Error During API Call", exception); return Response.status(exception.getHttpResponseCode()).entity(buildError(exception)).build(); } ApiExceptionMapper(); @Override Response toResponse(ApiException exception); ObjectMapper createObjectMapper(); Marshaller getMarshaller();  }### Answer:
@Test public void testValidateResponse() { ValidateException validateException = new ValidateException.Builder("Test Message", HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER) .build(); Response resp = mapper.toResponse((ApiException) validateException); assertEquals(resp.getStatus(), HttpStatus.SC_BAD_REQUEST); }
@Test public void testBPMNFailureResponse() { BPMNFailureException bpmnException = new BPMNFailureException.Builder("Test Message", HttpStatus.SC_NOT_FOUND, ErrorNumbers.SVC_BAD_PARAMETER).build(); Response resp = mapper.toResponse((ApiException) bpmnException); assertEquals(resp.getStatus(), HttpStatus.SC_NOT_FOUND); }
@Test public void testClientConnectionResponse() { ClientConnectionException clientConnectionException = new ClientConnectionException.Builder("test", HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_BAD_PARAMETER).build(); Response resp = mapper.toResponse((ApiException) clientConnectionException); assertEquals(resp.getStatus(), HttpStatus.SC_INTERNAL_SERVER_ERROR); }
@Test public void testVFModuleResponse() { VfModuleNotFoundException vfModuleException = new VfModuleNotFoundException.Builder("Test Message", HttpStatus.SC_CONFLICT, ErrorNumbers.SVC_BAD_PARAMETER).build(); Response resp = mapper.toResponse((ApiException) vfModuleException); assertEquals(resp.getStatus(), HttpStatus.SC_CONFLICT); }
@Test public void testDuplicateRequestResponse() throws IOException { DuplicateRequestException duplicateRequestException = new DuplicateRequestException.Builder("Test1", "Test2", "Test3", "Test4", HttpStatus.SC_BAD_GATEWAY, ErrorNumbers.SVC_BAD_PARAMETER).build(); Response resp = mapper.toResponse((ApiException) duplicateRequestException); assertEquals(resp.getStatus(), HttpStatus.SC_BAD_GATEWAY); }