protected void assertCreateRequest(ServiceTestInvocation testMethod) {
    addExpectForInitialRequest(testMethod);
    expect(requestFactory.createRequest(httpHeaders, requestBody, uriInfo,
        testMethod.getRequestType(), resourceInstance)).andReturn(request);
  }
Base class for service unit tests.
ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseServiceTest.java