Search in sources :

Example 1 with ApiGcpGcsBucketAttributes

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

the class MakeApiResourceDescriptionTest method mapReferencedGcsBucketTest.

@Test
public void mapReferencedGcsBucketTest() throws Exception {
    String bucketName = RandomStringUtils.randomAlphabetic(5).toLowerCase();
    var resource = new ReferencedGcsBucketResource(workspaceId, resourceId, resourceName, description, cloning, bucketName);
    ApiResourceDescription resourceDescription = resourceController.makeApiResourceDescription(resource);
    validateWsmResource(resourceDescription);
    ApiResourceAttributesUnion union = resourceDescription.getResourceAttributes();
    ApiGcpGcsBucketAttributes attributes = union.getGcpGcsBucket();
    assertThat(attributes, is(notNullValue()));
    assertEquals(attributes.getBucketName(), bucketName);
}
Also used : ReferencedGcsBucketResource(bio.terra.workspace.service.resource.referenced.cloud.gcp.gcsbucket.ReferencedGcsBucketResource) ApiResourceDescription(bio.terra.workspace.generated.model.ApiResourceDescription) ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion) ApiGcpGcsBucketAttributes(bio.terra.workspace.generated.model.ApiGcpGcsBucketAttributes) BaseUnitTest(bio.terra.workspace.common.BaseUnitTest) Test(org.junit.jupiter.api.Test)

Aggregations

BaseUnitTest (bio.terra.workspace.common.BaseUnitTest)1 ApiGcpGcsBucketAttributes (bio.terra.workspace.generated.model.ApiGcpGcsBucketAttributes)1 ApiResourceAttributesUnion (bio.terra.workspace.generated.model.ApiResourceAttributesUnion)1 ApiResourceDescription (bio.terra.workspace.generated.model.ApiResourceDescription)1 ReferencedGcsBucketResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.gcsbucket.ReferencedGcsBucketResource)1 Test (org.junit.jupiter.api.Test)1