use of bio.terra.janitor.model.AzureNetwork in project terra-cloud-resource-lib by DataBiosphere.
the class ComputeRequestDataTest method serializeCreateNetwork.
@Test
public void serializeCreateNetwork() {
CreateNetworkRequestData createNetwork = CreateNetworkRequestData.builder().setName("my-network").setTenantId("my-tenant").setSubscriptionId("my-sub").setResourceGroupName("my-rg").setRegion(Region.US_EAST).setAddressSpaceCidr("192.168.0.0/16").setSubnetName("my-subnet").setAddressPrefix("192.168.1.0/24").setNetworkSecurityGroup(mockNetworkSecurityGroup()).build();
assertEquals(ComputeManagerOperation.AZURE_CREATE_NETWORK, createNetwork.cloudOperation());
assertEquals("{\"tenantId\":\"my-tenant\",\"subscriptionId\":\"my-sub\",\"resourceGroupName\":\"my-rg\"," + "\"name\":\"my-network\",\"region\":\"eastus\"," + "\"addressSpaceCidr\":\"192.168.0.0/16\",\"subnetName\":\"my-subnet\"," + "\"addressPrefix\":\"192.168.1.0/24\",\"networkSecurityGroupName\":\"my-nsg\"}", createNetwork.serialize().toString());
assertEquals(Optional.of(new CloudResourceUid().azureNetwork(new AzureNetwork().resourceGroup(azureResourceGroup(createNetwork)).networkName("my-network"))), createNetwork.resourceUidCreation());
}
Aggregations