Search in sources :

Example 1 with UpdateWorkspaceRequestBody

use of bio.terra.workspace.model.UpdateWorkspaceRequestBody in project terra-workspace-manager by DataBiosphere.

the class WorkspaceLifecycle method doUserJourney.

@Override
public void doUserJourney(TestUserSpecification testUser, WorkspaceApi workspaceApi) throws ApiException {
    UUID workspaceId = UUID.randomUUID();
    CreateWorkspaceRequestBody requestBody = new CreateWorkspaceRequestBody().id(workspaceId).stage(WorkspaceStageModel.MC_WORKSPACE);
    workspaceApi.createWorkspace(requestBody);
    ClientTestUtils.assertHttpSuccess(workspaceApi, "CREATE workspace");
    WorkspaceDescription workspaceDescription = workspaceApi.getWorkspace(workspaceId);
    ClientTestUtils.assertHttpSuccess(workspaceApi, "GET workspace");
    assertThat(workspaceDescription.getId(), equalTo(workspaceId));
    assertThat(workspaceDescription.getStage(), equalTo(WorkspaceStageModel.MC_WORKSPACE));
    UpdateWorkspaceRequestBody updateBody = new UpdateWorkspaceRequestBody().displayName(workspaceName).description(workspaceDescriptionString);
    WorkspaceDescription updatedDescription = workspaceApi.updateWorkspace(updateBody, workspaceId);
    ClientTestUtils.assertHttpSuccess(workspaceApi, "PATCH workspace");
    assertThat(updatedDescription.getDisplayName(), equalTo(workspaceName));
    assertThat(updatedDescription.getDescription(), equalTo(workspaceDescriptionString));
    workspaceApi.deleteWorkspace(workspaceId);
    ClientTestUtils.assertHttpSuccess(workspaceApi, "DELETE workspace");
}
Also used : WorkspaceDescription(bio.terra.workspace.model.WorkspaceDescription) CreateWorkspaceRequestBody(bio.terra.workspace.model.CreateWorkspaceRequestBody) UUID(java.util.UUID) UpdateWorkspaceRequestBody(bio.terra.workspace.model.UpdateWorkspaceRequestBody)

Aggregations

CreateWorkspaceRequestBody (bio.terra.workspace.model.CreateWorkspaceRequestBody)1 UpdateWorkspaceRequestBody (bio.terra.workspace.model.UpdateWorkspaceRequestBody)1 WorkspaceDescription (bio.terra.workspace.model.WorkspaceDescription)1 UUID (java.util.UUID)1