Search in sources :

Example 1 with AzureDisk

use of bio.terra.janitor.model.AzureDisk in project terra-cloud-resource-lib by DataBiosphere.

the class ComputeRequestDataTest method serializeCreateDisk.

@Test
public void serializeCreateDisk() {
    CreateDiskRequestData createDisk = CreateDiskRequestData.builder().setName("my-disk").setTenantId("my-tenant").setSubscriptionId("my-sub").setResourceGroupName("my-rg").setRegion(Region.US_EAST).setSize(500).build();
    assertEquals(ComputeManagerOperation.AZURE_CREATE_DISK, createDisk.cloudOperation());
    assertEquals("{\"tenantId\":\"my-tenant\",\"subscriptionId\":\"my-sub\",\"resourceGroupName\":\"my-rg\",\"name\":\"my-disk\",\"region\":\"eastus\",\"size\":500}", createDisk.serialize().toString());
    assertEquals(Optional.of(new CloudResourceUid().azureDisk(new AzureDisk().resourceGroup(azureResourceGroup(createDisk)).diskName("my-disk"))), createDisk.resourceUidCreation());
}
Also used : CloudResourceUid(bio.terra.janitor.model.CloudResourceUid) CreateDiskRequestData(bio.terra.cloudres.azure.resourcemanager.compute.data.CreateDiskRequestData) AzureDisk(bio.terra.janitor.model.AzureDisk) Test(org.junit.jupiter.api.Test)

Aggregations

CreateDiskRequestData (bio.terra.cloudres.azure.resourcemanager.compute.data.CreateDiskRequestData)1 AzureDisk (bio.terra.janitor.model.AzureDisk)1 CloudResourceUid (bio.terra.janitor.model.CloudResourceUid)1 Test (org.junit.jupiter.api.Test)1