Search in sources :

Example 16 with ResourceList

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

the class ReferencedGitRepoLifecycle method doUserJourney.

@Override
protected void doUserJourney(TestUserSpecification testUser, WorkspaceApi workspaceApi) throws Exception {
    ReferencedGcpResourceApi referencedGcpResourceApi = ClientTestUtils.getReferencedGcpResourceClient(testUser, server);
    // Create the reference
    GitRepoResource gitResource = GitRepoUtils.makeGitRepoReference(gitRepoAttributes, referencedGcpResourceApi, getWorkspaceId(), MultiResourcesUtils.makeName());
    gitResourceId = gitResource.getMetadata().getResourceId();
    // Read the reference
    ResourceApi resourceApi = ClientTestUtils.getResourceClient(testUser, server);
    testGetReference(gitResource, referencedGcpResourceApi, resourceApi);
    // Clone the reference
    testCloneReference(gitResource, referencedGcpResourceApi, workspaceApi);
    // No validation checks yet, we don't validate access to git repos.
    // Update the reference
    testUpdateReference(referencedGcpResourceApi);
    // Delete the reference
    referencedGcpResourceApi.deleteGitRepoReference(getWorkspaceId(), gitResourceId);
    // Enumerating all resources with no filters should be empty
    ResourceList enumerateResult = resourceApi.enumerateResources(getWorkspaceId(), 0, 100, null, null);
    assertTrue(enumerateResult.getResources().isEmpty());
}
Also used : ReferencedGcpResourceApi(bio.terra.workspace.api.ReferencedGcpResourceApi) ResourceApi(bio.terra.workspace.api.ResourceApi) ResourceList(bio.terra.workspace.model.ResourceList) GitRepoResource(bio.terra.workspace.model.GitRepoResource) ReferencedGcpResourceApi(bio.terra.workspace.api.ReferencedGcpResourceApi)

Aggregations

ResourceList (bio.terra.workspace.model.ResourceList)16 ResourceApi (bio.terra.workspace.api.ResourceApi)14 GrantRoleRequestBody (bio.terra.workspace.model.GrantRoleRequestBody)9 ControlledGcpResourceApi (bio.terra.workspace.api.ControlledGcpResourceApi)8 ReferencedGcpResourceApi (bio.terra.workspace.api.ReferencedGcpResourceApi)8 ApiException (bio.terra.workspace.client.ApiException)6 UUID (java.util.UUID)5 GcpGcsBucketResource (bio.terra.workspace.model.GcpGcsBucketResource)4 ApiClient (bio.terra.workspace.client.ApiClient)3 CreatedControlledGcpGcsBucket (bio.terra.workspace.model.CreatedControlledGcpGcsBucket)3 GcpBigQueryDatasetResource (bio.terra.workspace.model.GcpBigQueryDatasetResource)3 WorkspaceApplicationApi (bio.terra.workspace.api.WorkspaceApplicationApi)2 DataRepoSnapshotResource (bio.terra.workspace.model.DataRepoSnapshotResource)2 GcpBigQueryDataTableResource (bio.terra.workspace.model.GcpBigQueryDataTableResource)2 GcpGcsObjectResource (bio.terra.workspace.model.GcpGcsObjectResource)2 GitRepoResource (bio.terra.workspace.model.GitRepoResource)2 ResourceDescription (bio.terra.workspace.model.ResourceDescription)2 WorkspaceApplicationDescription (bio.terra.workspace.model.WorkspaceApplicationDescription)2 Bucket (com.google.cloud.storage.Bucket)2 Storage (com.google.cloud.storage.Storage)2