test_class.declarator: exceptionMapper
test_class.modifier: private
test_class.original_string: private RpcExceptionMapper exceptionMapper;
test_class.type: RpcExceptionMapper
test_class.var_name: exceptionMapper
test_class.file: dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/RpcExceptionMapperTest.java
test_class.identifier: RpcExceptionMapperTest
test_case.body: @Test
      public void testNormalException() {
          RpcException rpcException = new RpcException();
          Response response = exceptionMapper.toResponse(rpcException);
  
  
          assertThat(response, not(nullValue()));
          assertThat(response.getEntity(), instanceOf(String.class));
      }
test_case.class_method_signature: RpcExceptionMapperTest.testNormalException()
test_case.full_signature: @Test public void testNormalException()
test_case.identifier: testNormalException
test_case.invocations: toResponse assertThat not nullValue assertThat getEntity instanceOf
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNormalException()
focal_class.file: dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/RpcExceptionMapper.java
focal_class.identifier: RpcExceptionMapper
focal_class.interfaces: implements ExceptionMapper<RpcException>
focal_class.class_method_signature: RpcExceptionMapper.toResponse(RpcException e)
focal_class.full_signature: @Override public Response toResponse(RpcException e)
focal_class.identifier: toResponse
focal_class.modifiers: @Override public
focal_class.parameters: (RpcException e)
focal_class.return: Response
focal_class.signature: Response toResponse(RpcException e)
focal_class.class_method_signature: RpcExceptionMapper.handleConstraintViolationException(ConstraintViolationException cve)
focal_class.full_signature: protected Response handleConstraintViolationException(ConstraintViolationException cve)
focal_class.identifier: handleConstraintViolationException
focal_class.modifiers: protected
focal_class.parameters: (ConstraintViolationException cve)
focal_class.return: Response
focal_class.signature: Response handleConstraintViolationException(ConstraintViolationException cve)
focal_method.body: @Override
      public Response toResponse(RpcException e) {
          // TODO do more sophisticated exception handling and output
          if (e.getCause() instanceof ConstraintViolationException) {
              return handleConstraintViolationException((ConstraintViolationException) e.getCause());
          }
          // we may want to avoid exposing the dubbo exception details to certain clients
          // TODO for now just do plain text output
          return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Internal server error: " + e.getMessage()).type(ContentType.TEXT_PLAIN_UTF_8).build();
      }
focal_method.class_method_signature: RpcExceptionMapper.toResponse(RpcException e)
focal_method.full_signature: @Override public Response toResponse(RpcException e)
focal_method.identifier: toResponse
focal_method.invocations: getCause handleConstraintViolationException getCause build type entity status getMessage
focal_method.modifiers: @Override public
focal_method.parameters: (RpcException e)
focal_method.return: Response
focal_method.signature: Response toResponse(RpcException e)