### Question:
ErrorResponseHelper { public AuthRepResponse createErrorAuthResponse(OAuthToken oAuthToken, ErrorReason reason, String path, String queryString, HttpMethod method, List<String> metricSysNames) { final String clientId; final String realm; if (oAuthToken != null) { clientId = oAuthToken.getClientId(); final TokenIssuer tokenIssuer = oAuthToken.getTokenIssuer(); realm = tokenIssuer != null ? tokenIssuer.getRealm() : ""; } else { clientId = null; realm = ""; } return createErrorAuthResponse(realm, clientId, reason, path, queryString, method, metricSysNames); } ErrorResponseHelper(ApimAdapterConfig config); AuthRepResponse createErrorAuthResponse(OAuthToken oAuthToken, ErrorReason reason, String path, String queryString, HttpMethod method, List<String> metricSysNames); AuthRepResponse createErrorAuthResponse(String realm, String clientId, ErrorReason reason, String path, String queryString, HttpMethod method, List<String> metricSysNames); static boolean isNotMonitoringUrl(String path);  }### Answer:
@Test public void createErrorAuthResponse() { String path = "/v1/locations"; HttpMethod method = HttpMethod.GET; String clientId = "187e4s30"; ErrorReason reason = ErrorReason.LIMIT_EXCEEDED; String expectedMessage = ErrorResponseHelper.createExtendedMessage(reason.getMessage(), path, "", method); ApimAdapterConfig apimAdapterConfig = ApimAdapterFactory.createApimAdapterConfig(); ErrorResponseHelper errorResponseHelper = new ErrorResponseHelper(apimAdapterConfig); AuthRepResponse generatedAuthResponse = errorResponseHelper.createErrorAuthResponse(AuthUtils.RH_SSO_REALM, clientId, reason, path, "", method, emptyList()); assertEquals(clientId, generatedAuthResponse.getClientId()); assertEquals(reason.getHttpStatus(), generatedAuthResponse.getHttpStatus()); assertEquals(expectedMessage, generatedAuthResponse.getMessage()); assertFalse(generatedAuthResponse.isAllowed()); }