private RestRequest createRestRequest(String accountName, String accountId, String containerName, String operation)
      throws Exception {
    JSONObject data = new JSONObject();
    data.put(MockRestRequest.REST_METHOD_KEY, RestMethod.GET.name());
    data.put(MockRestRequest.URI_KEY, operation);
    JSONObject headers = new JSONObject();
    if (accountName != null) {
      headers.put(RestUtils.Headers.TARGET_ACCOUNT_NAME, accountName);
    }
    if (accountId != null) {
      headers.put(RestUtils.Headers.TARGET_ACCOUNT_ID, accountId);
    }
    if (containerName != null) {
      headers.put(RestUtils.Headers.TARGET_CONTAINER_NAME, containerName);
    }
    data.put(MockRestRequest.HEADERS_KEY, headers);
    RestRequest restRequest = new MockRestRequest(data, null);
    restRequest.setArg(RestUtils.InternalKeys.REQUEST_PATH, RequestPath.parse(restRequest, null, null));
    return restRequest;
  }
Creates a {@link RestRequest} for a GET /accounts or /accounts/containers request
@param accountName if set, add this account name as a request header.
@param accountId if set, add this account ID as a request header.
@param containerName if set, add this container name as request header.
@param operation the operation this request will perform.
@return the {@link RestRequest}
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/GetAccountsHandlerTest.java