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);
}
Aggregations