private boolean shouldProceed(RestRequest restRequest, RestResponseChannel restResponseChannel)
      throws RestServiceException {
    if (restRequest == null) {
      throw new IllegalArgumentException("RestRequest is null");
    } else if (restResponseChannel == null) {
      throw new IllegalArgumentException("RestResponseChannel is null");
    } else if (!isRunning) {
      throw new RestServiceException("MockRestRequestResponseHandler is not running",
          RestServiceErrorCode.ServiceUnavailable);
    } else if (failureProperties != null) {
      if (failureProperties.containsKey(RUNTIME_EXCEPTION_ON_HANDLE) && failureProperties.getBoolean(
          RUNTIME_EXCEPTION_ON_HANDLE)) {
        throw new RuntimeException(RUNTIME_EXCEPTION_ON_HANDLE);
      } else if (failureProperties.containsKey(REST_EXCEPTION_ON_HANDLE)) {
        RestServiceErrorCode errorCode = RestServiceErrorCode.InternalServerError;
        try {
          errorCode = RestServiceErrorCode.valueOf(failureProperties.getString(REST_EXCEPTION_ON_HANDLE));
        } catch (IllegalArgumentException e) {
          // it's alright.
        }
        throw new RestServiceException(REST_EXCEPTION_ON_HANDLE, errorCode);
      }
    }
    return failureProperties == null;
  }
If the MockRestRequestResponseHandler is supposed to be breakdown, throws the right exception.
@param restRequest the {@link RestRequest} that needs to be handled.
@param restResponseChannel the {@link RestResponseChannel} on which a response to the request may be sent.
@return {@code true} if the the caller can proceed. {@code false} otherwise.
@throws RestServiceException
ambry-api/src/test/java/com/github/ambry/rest/MockRestRequestResponseHandler.java