Search in sources :

Example 1 with AzurePublicIp

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

the class ComputeRequestDataTest method serializeCreatePublicIp.

@Test
public void serializeCreatePublicIp() {
    CreatePublicIpRequestData createPublicIp = CreatePublicIpRequestData.builder().setName("my-ip").setTenantId("my-tenant").setSubscriptionId("my-sub").setResourceGroupName("my-rg").setRegion(Region.US_EAST).setIpAllocationMethod(IpAllocationMethod.DYNAMIC).build();
    assertEquals(ComputeManagerOperation.AZURE_CREATE_PUBLIC_IP, createPublicIp.cloudOperation());
    assertEquals("{\"tenantId\":\"my-tenant\",\"subscriptionId\":\"my-sub\",\"resourceGroupName\":\"my-rg\"," + "\"name\":\"my-ip\",\"region\":\"eastus\"," + "\"ipAllocationMethod\":\"Dynamic\"}", createPublicIp.serialize().toString());
    assertEquals(Optional.of(new CloudResourceUid().azurePublicIp(new AzurePublicIp().resourceGroup(azureResourceGroup(createPublicIp)).ipName("my-ip"))), createPublicIp.resourceUidCreation());
}
Also used : CloudResourceUid(bio.terra.janitor.model.CloudResourceUid) CreatePublicIpRequestData(bio.terra.cloudres.azure.resourcemanager.compute.data.CreatePublicIpRequestData) AzurePublicIp(bio.terra.janitor.model.AzurePublicIp) Test(org.junit.jupiter.api.Test)

Aggregations

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