@Test(expected = IllegalArgumentException.class) public void createOrganizationThrows() throws Exception { OrganizationImpl.createOrganization(invalidCreateOrganizationInputs); }
@NotNull public static Map<String, String> createOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createOrganizationUrl(createOrganizationInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createOrganizationInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createOrganizationInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createOrganizationBody(createOrganizationInputs, DELIMITER)); } else { httpClientInputs.setBody(createOrganizationInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createOrganizationInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createOrganizationInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }
OrganizationImpl { @NotNull public static Map<String, String> createOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createOrganizationUrl(createOrganizationInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createOrganizationInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createOrganizationInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createOrganizationBody(createOrganizationInputs, DELIMITER)); } else { httpClientInputs.setBody(createOrganizationInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createOrganizationInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createOrganizationInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); } }
OrganizationImpl { @NotNull public static Map<String, String> createOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createOrganizationUrl(createOrganizationInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createOrganizationInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createOrganizationInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createOrganizationBody(createOrganizationInputs, DELIMITER)); } else { httpClientInputs.setBody(createOrganizationInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createOrganizationInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createOrganizationInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }  }
OrganizationImpl { @NotNull public static Map<String, String> createOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createOrganizationUrl(createOrganizationInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createOrganizationInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createOrganizationInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createOrganizationBody(createOrganizationInputs, DELIMITER)); } else { httpClientInputs.setBody(createOrganizationInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createOrganizationInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createOrganizationInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }  @NotNull static Map<String, String> createOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs); @NotNull static Map<String, String> updateOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs); @NotNull static Map<String, String> deleteOrganization(@NotNull final TerraformOrganizationInputs deleteOrganizationInputs); @NotNull static Map<String, String> listOrganizations(@NotNull final TerraformCommonInputs listOrganizationsInputs); @NotNull static Map<String, String> getOrganizationDetails(@NotNull final TerraformOrganizationInputs
                                                                     getOrganizationDetailsInputs); @NotNull static String getOrganizationPath(@NotNull final String organizationName); @NotNull static String getOrganizationDetailsPath(@NotNull final String organizationName); @NotNull static String createOrganizationBody(TerraformOrganizationInputs createOrganizationInputs, String delimiter); }
OrganizationImpl { @NotNull public static Map<String, String> createOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createOrganizationUrl(createOrganizationInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createOrganizationInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createOrganizationInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createOrganizationBody(createOrganizationInputs, DELIMITER)); } else { httpClientInputs.setBody(createOrganizationInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createOrganizationInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createOrganizationInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }  @NotNull static Map<String, String> createOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs); @NotNull static Map<String, String> updateOrganization(@NotNull final TerraformOrganizationInputs createOrganizationInputs); @NotNull static Map<String, String> deleteOrganization(@NotNull final TerraformOrganizationInputs deleteOrganizationInputs); @NotNull static Map<String, String> listOrganizations(@NotNull final TerraformCommonInputs listOrganizationsInputs); @NotNull static Map<String, String> getOrganizationDetails(@NotNull final TerraformOrganizationInputs
                                                                     getOrganizationDetailsInputs); @NotNull static String getOrganizationPath(@NotNull final String organizationName); @NotNull static String getOrganizationDetailsPath(@NotNull final String organizationName); @NotNull static String createOrganizationBody(TerraformOrganizationInputs createOrganizationInputs, String delimiter);  }