Search in sources :

Example 1 with ApiGcpBigQueryDataTableAttributes

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

the class MakeApiResourceDescriptionTest method mapReferencedBigQueryDataTableTest.

@Test
public void mapReferencedBigQueryDataTableTest() throws Exception {
    String projectId = RandomStringUtils.randomAlphabetic(12);
    String datasetName = RandomStringUtils.randomAlphabetic(12);
    String datatableName = RandomStringUtils.randomAlphabetic(12);
    var resource = new ReferencedBigQueryDataTableResource(workspaceId, resourceId, resourceName, description, cloning, projectId, datasetName, datatableName);
    ApiResourceDescription resourceDescription = resourceController.makeApiResourceDescription(resource);
    validateWsmResource(resourceDescription);
    ApiResourceAttributesUnion union = resourceDescription.getResourceAttributes();
    ApiGcpBigQueryDataTableAttributes attributes = union.getGcpBqDataTable();
    assertThat(attributes, is(notNullValue()));
    assertEquals(attributes.getDatasetId(), datasetName);
    assertEquals(attributes.getProjectId(), projectId);
    assertEquals(attributes.getDataTableId(), datatableName);
}
Also used : ApiGcpBigQueryDataTableAttributes(bio.terra.workspace.generated.model.ApiGcpBigQueryDataTableAttributes) ApiResourceDescription(bio.terra.workspace.generated.model.ApiResourceDescription) ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion) ReferencedBigQueryDataTableResource(bio.terra.workspace.service.resource.referenced.cloud.gcp.bqdatatable.ReferencedBigQueryDataTableResource) BaseUnitTest(bio.terra.workspace.common.BaseUnitTest) Test(org.junit.jupiter.api.Test)

Aggregations

BaseUnitTest (bio.terra.workspace.common.BaseUnitTest)1 ApiGcpBigQueryDataTableAttributes (bio.terra.workspace.generated.model.ApiGcpBigQueryDataTableAttributes)1 ApiResourceAttributesUnion (bio.terra.workspace.generated.model.ApiResourceAttributesUnion)1 ApiResourceDescription (bio.terra.workspace.generated.model.ApiResourceDescription)1 ReferencedBigQueryDataTableResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.bqdatatable.ReferencedBigQueryDataTableResource)1 Test (org.junit.jupiter.api.Test)1