class NamingClientResponseValidator {

    public String validateNameGenDeleteResponse(ResponseEntity<NameGenDeleteResponse> response)
            throws BadResponseException {
        if (response == null) {
            logger.error(LoggingAnchor.FIVE, MessageEnum.RA_GENERAL_EXCEPTION.toString(),
                    NO_RESPONSE_FROM_NAMING_SERVICE, "BPMN", ErrorCode.UnknownError.getValue(),
                    NO_RESPONSE_FROM_NAMING_SERVICE);
            throw new BadResponseException(NO_RESPONSE_FROM_NAMING_SERVICE);
        }

        int responseCode = response.getStatusCodeValue();
        String responseMessage = "";
        NameGenDeleteResponse responseBody = response.getBody();
        if (responseBody == null) {
            logger.error(LoggingAnchor.FIVE, MessageEnum.RA_GENERAL_EXCEPTION.toString(),
                    NULL_RESPONSE_FROM_NAMING_SERVICE, "BPMN", ErrorCode.UnknownError.getValue(),
                    NULL_RESPONSE_FROM_NAMING_SERVICE);
            throw new BadResponseException(NULL_RESPONSE_FROM_NAMING_SERVICE);
        }

        if (isHttpCodeSuccess(responseCode)) {
            logger.info("Successful Response from Naming Service");
            return responseMessage;
        } else {
            String errorMessageString = NAMING_SERVICE_ERROR;

            String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString);
            logger.error(LoggingAnchor.FIVE, MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN",
                    ErrorCode.DataError.getValue(), errorMessage);
            throw new BadResponseException(errorMessage);
        }
    }

}