/** ********************* Enterprise Limits ********************** */
  public void testCreateLimits() throws SecurityException, NoSuchMethodException, IOException {
    EnterpriseDto enterprise = EnterpriseResources.enterprisePut();
    DatacenterDto datacenter = InfrastructureResources.datacenterPut();
    DatacenterLimitsDto limits = EnterpriseResources.datacenterLimitsPost();

    Method method =
        EnterpriseAsyncClient.class.getMethod(
            "createLimits", EnterpriseDto.class, DatacenterDto.class, DatacenterLimitsDto.class);
    GeneratedHttpRequest<EnterpriseAsyncClient> request =
        processor.createRequest(method, enterprise, datacenter, limits);

    String limitsUri = enterprise.searchLink("limits").getHref();
    String requestURI =
        String.format("POST %s?datacenter=%d HTTP/1.1", limitsUri, datacenter.getId());

    assertRequestLineEquals(request, requestURI);
    assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterLimitsDto.BASE_MEDIA_TYPE + "\n");
    assertPayloadEquals(
        request,
        withHeader(EnterpriseResources.datacenterLimitsPostPayload()),
        DatacenterLimitsDto.BASE_MEDIA_TYPE,
        false);

    assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
    assertSaxResponseParserClassEquals(method, null);
    assertExceptionParserClassEquals(method, null);

    checkFilters(request);
  }
  public void testListTemplateListStatus()
      throws SecurityException, NoSuchMethodException, IOException {
    Method method =
        EnterpriseAsyncClient.class.getMethod(
            "listTemplateListStatus", TemplateDefinitionListDto.class, DatacenterDto.class);
    GeneratedHttpRequest<EnterpriseAsyncClient> request =
        processor.createRequest(
            method, EnterpriseResources.templateListPut(), InfrastructureResources.datacenterPut());

    assertRequestLineEquals(
        request,
        "GET http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists/1/actions/repositoryStatus?datacenterId=1 HTTP/1.1");
    assertNonPayloadHeadersEqual(request, "Accept: " + TemplatesStateDto.BASE_MEDIA_TYPE + "\n");
    assertPayloadEquals(request, null, null, false);

    assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
    assertSaxResponseParserClassEquals(method, null);
    assertExceptionParserClassEquals(method, null);

    checkFilters(request);
  }
  public void testListEnterprisesByDatacenter()
      throws SecurityException, NoSuchMethodException, IOException {
    EnterpriseOptions options =
        EnterpriseOptions.builder().startWith(0).limit(25).network(true).build();

    Method method =
        EnterpriseAsyncClient.class.getMethod(
            "listEnterprises", DatacenterDto.class, EnterpriseOptions.class);
    GeneratedHttpRequest<EnterpriseAsyncClient> request =
        processor.createRequest(method, InfrastructureResources.datacenterPut(), options);

    assertRequestLineEquals(
        request,
        "GET http://localhost/api/admin/datacenters/1/action/enterprises?network=true&startwith=0&limit=25 HTTP/1.1");
    assertNonPayloadHeadersEqual(request, "Accept: " + EnterprisesDto.BASE_MEDIA_TYPE + "\n");
    assertPayloadEquals(request, null, null, false);

    assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
    assertSaxResponseParserClassEquals(method, null);
    assertExceptionParserClassEquals(method, null);

    checkFilters(request);
  }
  /** ********************* Datacenter Repository ********************** */
  public void testRefreshTemplateRepository()
      throws SecurityException, NoSuchMethodException, IOException {
    Method method =
        EnterpriseAsyncClient.class.getMethod(
            "refreshTemplateRepository", Integer.class, Integer.class);
    GeneratedHttpRequest<EnterpriseAsyncClient> request =
        processor.createRequest(
            method,
            EnterpriseResources.enterprisePut().getId(),
            InfrastructureResources.datacenterPut().getId());

    assertRequestLineEquals(
        request,
        "PUT http://localhost/api/admin/enterprises/1/datacenterrepositories/1/actions/refresh HTTP/1.1");
    assertNonPayloadHeadersEqual(request, "");
    assertPayloadEquals(request, null, null, false);

    assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
    assertSaxResponseParserClassEquals(method, null);
    assertExceptionParserClassEquals(method, null);

    checkFilters(request);
  }