public void buildCalls(CougarMessageContentTypeEnum responseContentTypeEnum) {

      for (int i = 0; i < numberOfRequests + 1; i++) {
        // Setup call beans
        HttpCallBean callBean = new HttpCallBean();
        callBean.setServiceName("baseline", "cougarBaseline");
        callBean.setVersion("v2");
        callBean.setOperationName("testParameterStylesQA");

        Map<String, String> headerParams = new HashMap<String, String>();
        headerParams.put("headerParam", "Foo");
        callBean.setHeaderParams(headerParams);

        Map<String, String> queryParams = new HashMap<String, String>();
        String queryParameter = "queryParameter-" + identifier + "-" + i;
        queryParams.put("queryParam", queryParameter);
        String dateQueryParameter = "2009-06-01T13:50:00.0Z";
        queryParams.put("dateQueryParam", dateQueryParameter);
        callBean.setQueryParams(queryParams);

        httpCallBeans.add(callBean);

        Map<String, String> acceptProtocols = new HashMap<String, String>();
        switch (responseContentTypeEnum) {
          case JSON:
            acceptProtocols.put("application/json", "");
            break;
          case XML:
            acceptProtocols.put("application/xml", "");
            break;
        }
        callBean.setAcceptProtocols(acceptProtocols);

        // Store expected responses
        HttpResponseBean responseBean = new HttpResponseBean();
        String responseXmlString =
            "<SimpleResponse><message>headerParam=Foo,queryParam="
                + queryParameter
                + ",dateQueryParam=Mon Jun 01 13:50:00 UTC 2009</message></SimpleResponse>";
        Document responseBaseObject = xHelpers.getXMLObjectFromString(responseXmlString);
        Map<CougarMessageProtocolRequestTypeEnum, Object> builtExpectedResponse =
            cougarManager.convertResponseToRestTypes(responseBaseObject, callBean);
        switch (responseContentTypeEnum) {
          case XML:
            responseBean.setResponseObject(
                builtExpectedResponse.get(CougarMessageProtocolRequestTypeEnum.RESTXML));
            break;
          case JSON:
            responseBean.setResponseObject(
                builtExpectedResponse.get(CougarMessageProtocolRequestTypeEnum.RESTJSON));
            break;
        }
        responseBean.setHttpStatusCode(OK_STATUS_CODE);
        responseBean.setHttpStatusText("OK");

        expectedResponses.put(identifier + RESPONSE + i, responseBean);
      }
    }
    public void buildCalls(CougarMessageContentTypeEnum responseContentTypeEnum) {

      for (int i = 0; i < numberOfRequests + 1; i++) {
        // Setup call beans
        HttpCallBean callBean = new HttpCallBean();
        callBean.setServiceName("baseline", "cougarBaseline");
        callBean.setVersion("v2");
        callBean.setOperationName("testComplexMutator", "complex");

        Map<String, String> acceptProtocols = new HashMap<String, String>();
        switch (responseContentTypeEnum) {
          case JSON:
            acceptProtocols.put("application/json", "");
            break;
          case XML:
            acceptProtocols.put("application/xml", "");
            break;
        }
        callBean.setAcceptProtocols(acceptProtocols);

        String requestXmlString = "";
        requestXmlString =
            "<message><name>sum</name><value1> "
                + i
                + "</value1><value2>"
                + i
                + "</value2></message>";
        Document requestDocument = xHelpers.getXMLObjectFromString(requestXmlString);
        callBean.setRestPostQueryObjects(requestDocument);
        httpCallBeans.add(callBean);

        // Store expected responses
        HttpResponseBean responseBean = new HttpResponseBean();
        String responseXmlString =
            "<SimpleResponse><message>sum = " + i * 2 + "</message></SimpleResponse>";
        Document responseBaseObject = xHelpers.getXMLObjectFromString(responseXmlString);
        Map<CougarMessageProtocolRequestTypeEnum, Object> builtExpectedResponse =
            cougarManager.convertResponseToRestTypes(responseBaseObject, callBean);
        switch (responseContentTypeEnum) {
          case XML:
            responseBean.setResponseObject(
                builtExpectedResponse.get(CougarMessageProtocolRequestTypeEnum.RESTXML));
            break;
          case JSON:
            responseBean.setResponseObject(
                builtExpectedResponse.get(CougarMessageProtocolRequestTypeEnum.RESTJSON));
            break;
        }
        responseBean.setHttpStatusCode(OK_STATUS_CODE);
        responseBean.setHttpStatusText("OK");

        expectedResponses.put(identifier + RESPONSE + i, responseBean);
      }
    }
  @Test
  public void doTest() throws Exception {
    // Create the HttpCallBean
    CougarManager cougarManager1 = CougarManager.getInstance();
    HttpCallBean httpCallBeanBaseline = cougarManager1.getNewHttpCallBean();
    CougarManager cougarManagerBaseline = cougarManager1;
    // Get the cougar logging attribute for getting log entries later
    // Point the created HttpCallBean at the correct service
    httpCallBeanBaseline.setServiceName("baseline", "cougarBaseline");

    httpCallBeanBaseline.setVersion("v2");
    // Set up the Http Call Bean to make the request
    CougarManager cougarManager2 = CougarManager.getInstance();
    HttpCallBean getNewHttpCallBean2 = cougarManager2.getNewHttpCallBean("87.248.113.14");
    cougarManager2 = cougarManager2;

    cougarManager2.setCougarFaultControllerJMXMBeanAttrbiute("DetailedFaults", "false");

    getNewHttpCallBean2.setOperationName("testComplexMutator", "complex");

    getNewHttpCallBean2.setServiceName("baseline", "cougarBaseline");

    getNewHttpCallBean2.setVersion("v2");
    // Set the response protocols (with an unsupported protocol ranked highest)
    Map map3 = new HashMap();
    map3.put("application/text", "q=70");
    map3.put("application/image", "q=30");
    getNewHttpCallBean2.setAcceptProtocols(map3);

    getNewHttpCallBean2.setRestPostQueryObjects(
        DocumentBuilderFactory.newInstance()
            .newDocumentBuilder()
            .parse(
                new ByteArrayInputStream(
                    "<message><name>sum</name><value1>7</value1><value2>75</value2></message>"
                        .getBytes())));
    // Get current time for getting log entries later

    Timestamp getTimeAsTimeStamp10 = new Timestamp(System.currentTimeMillis());
    // Make the XML call to the operation
    cougarManager2.makeRestCougarHTTPCall(
        getNewHttpCallBean2,
        com.betfair.testing.utils.cougar.enums.CougarMessageProtocolRequestTypeEnum.RESTXML);
    // Create the expected response as an XML document
    XMLHelpers xMLHelpers5 = new XMLHelpers();
    Document createAsDocument12 =
        xMLHelpers5.getXMLObjectFromString(
            "<fault><faultcode>Client</faultcode><faultstring>DSC-0013</faultstring><detail/></fault>");
    // Convert the expected response to REST types
    Map<CougarMessageProtocolRequestTypeEnum, Object> convertResponseToRestTypes13 =
        cougarManager2.convertResponseToRestTypes(createAsDocument12, getNewHttpCallBean2);
    // Check the response is as expected (fault)
    HttpResponseBean getResponseObjectsByEnum14 =
        getNewHttpCallBean2.getResponseObjectsByEnum(
            com.betfair.testing.utils.cougar.enums.CougarMessageProtocolResponseTypeEnum.REST);
    AssertionUtils.multiAssertEquals(
        convertResponseToRestTypes13.get(CougarMessageProtocolRequestTypeEnum.RESTXML),
        getResponseObjectsByEnum14.getResponseObject());
    AssertionUtils.multiAssertEquals((int) 406, getResponseObjectsByEnum14.getHttpStatusCode());
    AssertionUtils.multiAssertEquals(
        "Not Acceptable", getResponseObjectsByEnum14.getHttpStatusText());

    Map<String, String> map7 = getResponseObjectsByEnum14.getResponseHeaders();
    AssertionUtils.multiAssertEquals("application/xml", map7.get("Content-Type"));
    // Check the log entries are as expected

    cougarManagerBaseline.verifyAccessLogEntriesAfterDate(
        getTimeAsTimeStamp10,
        new AccessLogRequirement(
            "87.248.113.14", "/cougarBaseline/v2/complex", "MediaTypeNotAcceptable"));
  }