@Override
    public Object result(RpcException e) {

        // javax dependency judge
        if (violationDependency()) {
            //  ConstraintViolationException judge
            if (ConstraintViolationExceptionConvert.needConvert(e)) {
                return ConstraintViolationExceptionConvert.handleConstraintViolationException(e);
            }
        }

        return "Internal server error: " + e.getMessage();
    }
@Test
    void testConstraintViolationException() {
        ConstraintViolationException violationException = mock(ConstraintViolationException.class);
        ConstraintViolation<?> violation = mock(ConstraintViolation.class, Answers.RETURNS_DEEP_STUBS);
        given(violationException.getConstraintViolations()).willReturn(Sets.newSet(violation));
        RpcException rpcException = new RpcException("violation", violationException);

        Object response = exceptionMapper.result(rpcException);

        assertThat(response, not(nullValue()));
        assertThat(response, instanceOf(ViolationReport.class));
    }