@Test(expected = IllegalArgumentException.class) public void createWorkspaceThrows() throws Exception { WorkspaceImpl.createWorkspace(invalidCreateWorkspaceInputs); }
@NotNull public static Map<String, String> createWorkspace(@NotNull final TerraformWorkspaceInputs createWorkspaceInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createWorkspaceUrl(createWorkspaceInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createWorkspaceInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createWorkspaceInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createWorkspaceBody(createWorkspaceInputs, DELIMITER)); } else { httpClientInputs.setBody(createWorkspaceInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createWorkspaceInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createWorkspaceInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }
WorkspaceImpl { @NotNull public static Map<String, String> createWorkspace(@NotNull final TerraformWorkspaceInputs createWorkspaceInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createWorkspaceUrl(createWorkspaceInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createWorkspaceInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createWorkspaceInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createWorkspaceBody(createWorkspaceInputs, DELIMITER)); } else { httpClientInputs.setBody(createWorkspaceInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createWorkspaceInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createWorkspaceInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); } }
WorkspaceImpl { @NotNull public static Map<String, String> createWorkspace(@NotNull final TerraformWorkspaceInputs createWorkspaceInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createWorkspaceUrl(createWorkspaceInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createWorkspaceInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createWorkspaceInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createWorkspaceBody(createWorkspaceInputs, DELIMITER)); } else { httpClientInputs.setBody(createWorkspaceInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createWorkspaceInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createWorkspaceInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }  }
WorkspaceImpl { @NotNull public static Map<String, String> createWorkspace(@NotNull final TerraformWorkspaceInputs createWorkspaceInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createWorkspaceUrl(createWorkspaceInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createWorkspaceInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createWorkspaceInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createWorkspaceBody(createWorkspaceInputs, DELIMITER)); } else { httpClientInputs.setBody(createWorkspaceInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createWorkspaceInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createWorkspaceInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }  @NotNull static Map<String, String> createWorkspace(@NotNull final TerraformWorkspaceInputs createWorkspaceInputs); @NotNull static Map<String, String> deleteWorkspace(@NotNull final TerraformWorkspaceInputs deleteWorkspaceInputs); @NotNull static Map<String, String> listWorkspaces(@NotNull final TerraformCommonInputs listWorkspacesInputs); @NotNull static Map<String, String> getWorkspaceDetails(@NotNull final TerraformWorkspaceInputs
                                                                  getWorkspaceDetailsInputs); @NotNull static String getWorkspacePath(@NotNull final String organizationName); @NotNull static String getWorkspaceDetailsPath(@NotNull final String organizationName,
                                                 @NotNull final String workspaceName); @NotNull static String createWorkspaceBody(TerraformWorkspaceInputs createWorkspaceInputs, String delimiter); }
WorkspaceImpl { @NotNull public static Map<String, String> createWorkspace(@NotNull final TerraformWorkspaceInputs createWorkspaceInputs) throws Exception { final HttpClientInputs httpClientInputs = new HttpClientInputs(); httpClientInputs.setUrl(createWorkspaceUrl(createWorkspaceInputs.getCommonInputs().getOrganizationName())); setCommonHttpInputs(httpClientInputs, createWorkspaceInputs.getCommonInputs()); httpClientInputs.setAuthType(ANONYMOUS); httpClientInputs.setMethod(POST); httpClientInputs.setContentType(APPLICATION_VND_API_JSON); if (createWorkspaceInputs.getCommonInputs().getRequestBody().equals(EMPTY)) { httpClientInputs.setBody(createWorkspaceBody(createWorkspaceInputs, DELIMITER)); } else { httpClientInputs.setBody(createWorkspaceInputs.getCommonInputs().getRequestBody()); } httpClientInputs.setResponseCharacterSet(createWorkspaceInputs.getCommonInputs().getResponseCharacterSet()); httpClientInputs.setHeaders(getAuthHeaders(createWorkspaceInputs.getCommonInputs().getAuthToken())); return new HttpClientService().execute(httpClientInputs); }  @NotNull static Map<String, String> createWorkspace(@NotNull final TerraformWorkspaceInputs createWorkspaceInputs); @NotNull static Map<String, String> deleteWorkspace(@NotNull final TerraformWorkspaceInputs deleteWorkspaceInputs); @NotNull static Map<String, String> listWorkspaces(@NotNull final TerraformCommonInputs listWorkspacesInputs); @NotNull static Map<String, String> getWorkspaceDetails(@NotNull final TerraformWorkspaceInputs
                                                                  getWorkspaceDetailsInputs); @NotNull static String getWorkspacePath(@NotNull final String organizationName); @NotNull static String getWorkspaceDetailsPath(@NotNull final String organizationName,
                                                 @NotNull final String workspaceName); @NotNull static String createWorkspaceBody(TerraformWorkspaceInputs createWorkspaceInputs, String delimiter);  }