@Test public void testTechnicalCustomRuntimeServerExceptionExposed() { RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); exceptionFacade.setExposeInternalErrorDetails(true); String message = "Internal server error occurred"; IllegalCaseException error = new IllegalCaseException(message); String expectedMessage = "TechnicalErrorUserException: An unexpected error has occurred! We apologize any inconvenience. Please try again later." + System.lineSeparator() + error.getClass().getSimpleName() + ": " + error.getLocalizedMessage(); checkFacade(exceptionFacade, error, 500, expectedMessage, error.getUuid().toString(), CODE_TECHNICAL_ERROR); }
public void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails) { this.exposeInternalErrorDetails = exposeInternalErrorDetails; if (exposeInternalErrorDetails) { String message = "****** Exposing of internal error details is enabled! This violates OWASP A6 (Sensitive Data Exposure) and shall only be used for testing/debugging and never in production. ******"; LOG.warn(message); System.err.println(message); } }
RestServiceExceptionFacade implements ExceptionMapper<Throwable> { public void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails) { this.exposeInternalErrorDetails = exposeInternalErrorDetails; if (exposeInternalErrorDetails) { String message = "****** Exposing of internal error details is enabled! This violates OWASP A6 (Sensitive Data Exposure) and shall only be used for testing/debugging and never in production. ******"; LOG.warn(message); System.err.println(message); } } }
RestServiceExceptionFacade implements ExceptionMapper<Throwable> { public void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails) { this.exposeInternalErrorDetails = exposeInternalErrorDetails; if (exposeInternalErrorDetails) { String message = "****** Exposing of internal error details is enabled! This violates OWASP A6 (Sensitive Data Exposure) and shall only be used for testing/debugging and never in production. ******"; LOG.warn(message); System.err.println(message); } } RestServiceExceptionFacade(); }
RestServiceExceptionFacade implements ExceptionMapper<Throwable> { public void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails) { this.exposeInternalErrorDetails = exposeInternalErrorDetails; if (exposeInternalErrorDetails) { String message = "****** Exposing of internal error details is enabled! This violates OWASP A6 (Sensitive Data Exposure) and shall only be used for testing/debugging and never in production. ******"; LOG.warn(message); System.err.println(message); } } RestServiceExceptionFacade(); @Override Response toResponse(Throwable exception); ObjectMapper getMapper(); @Inject void setMapper(ObjectMapper mapper); void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails); boolean isExposeInternalErrorDetails(); }
RestServiceExceptionFacade implements ExceptionMapper<Throwable> { public void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails) { this.exposeInternalErrorDetails = exposeInternalErrorDetails; if (exposeInternalErrorDetails) { String message = "****** Exposing of internal error details is enabled! This violates OWASP A6 (Sensitive Data Exposure) and shall only be used for testing/debugging and never in production. ******"; LOG.warn(message); System.err.println(message); } } RestServiceExceptionFacade(); @Override Response toResponse(Throwable exception); ObjectMapper getMapper(); @Inject void setMapper(ObjectMapper mapper); void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails); boolean isExposeInternalErrorDetails();  }