Search in sources :

Example 1 with ApiDataRepoSnapshotAttributes

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

the class MakeApiResourceDescriptionTest method mapReferencedDataRepoSnapshotTest.

@Test
public void mapReferencedDataRepoSnapshotTest() throws Exception {
    String snapshotId = UUID.randomUUID().toString();
    String instanceName = RandomStringUtils.randomAlphabetic(5);
    var resource = new ReferencedDataRepoSnapshotResource(workspaceId, resourceId, resourceName, description, cloning, instanceName, snapshotId);
    ApiResourceDescription resourceDescription = resourceController.makeApiResourceDescription(resource);
    validateWsmResource(resourceDescription);
    ApiResourceAttributesUnion union = resourceDescription.getResourceAttributes();
    ApiDataRepoSnapshotAttributes attributes = union.getGcpDataRepoSnapshot();
    assertThat(attributes, is(notNullValue()));
    assertEquals(attributes.getInstanceName(), instanceName);
    assertEquals(attributes.getSnapshot(), snapshotId);
}
Also used : ApiDataRepoSnapshotAttributes(bio.terra.workspace.generated.model.ApiDataRepoSnapshotAttributes) ApiResourceDescription(bio.terra.workspace.generated.model.ApiResourceDescription) ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion) ReferencedDataRepoSnapshotResource(bio.terra.workspace.service.resource.referenced.cloud.gcp.datareposnapshot.ReferencedDataRepoSnapshotResource) BaseUnitTest(bio.terra.workspace.common.BaseUnitTest) Test(org.junit.jupiter.api.Test)

Aggregations

BaseUnitTest (bio.terra.workspace.common.BaseUnitTest)1 ApiDataRepoSnapshotAttributes (bio.terra.workspace.generated.model.ApiDataRepoSnapshotAttributes)1 ApiResourceAttributesUnion (bio.terra.workspace.generated.model.ApiResourceAttributesUnion)1 ApiResourceDescription (bio.terra.workspace.generated.model.ApiResourceDescription)1 ReferencedDataRepoSnapshotResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.datareposnapshot.ReferencedDataRepoSnapshotResource)1 Test (org.junit.jupiter.api.Test)1