private void sendAndVerifyRequestControlRequest(RequestOrResponseType toControl, boolean enable, PartitionId id,
      ServerErrorCode expectedServerErrorCode) throws InterruptedException, IOException {
    int correlationId = TestUtils.RANDOM.nextInt();
    String clientId = TestUtils.getRandomString(10);
    AdminRequest adminRequest =
        new AdminRequest(AdminRequestOrResponseType.RequestControl, id, correlationId, clientId);
    RequestControlAdminRequest controlRequest = new RequestControlAdminRequest(toControl, enable, adminRequest);
    Response response = sendRequestGetResponse(controlRequest, expectedServerErrorCode);
    assertTrue("Response not of type AdminResponse", response instanceof AdminResponse);
    response.release();
  }
Sends and verifies that a {@link AdminRequestOrResponseType#RequestControl} request received the error code
expected.
@param toControl the {@link AdminRequestOrResponseType#RequestControl} to control.
@param enable {@code true} if {@code toControl} needs to be enabled. {@code false} otherwise.
@param id the {@link PartitionId} to send the request for. Can be {@code null}.
@param expectedServerErrorCode the {@link ServerErrorCode} expected in the response.
@throws InterruptedException
@throws IOException
ambry-server/src/test/java/com/github/ambry/server/AmbryServerRequestsTest.java