use of bio.terra.janitor.model.AzureNetworkSecurityGroup in project terra-cloud-resource-lib by DataBiosphere.
the class ComputeRequestDataTest method serializeCreateNetworkSecurityGroup.
@Test
public void serializeCreateNetworkSecurityGroup() {
CreateNetworkSecurityGroupRequestData createNetworkSecurityGroup = CreateNetworkSecurityGroupRequestData.builder().setName("my-nsg").setTenantId("my-tenant").setSubscriptionId("my-sub").setResourceGroupName("my-rg").setRegion(Region.US_EAST).setRules(ImmutableList.of("rule1", "rule2")).build();
assertEquals(ComputeManagerOperation.AZURE_CREATE_NETWORK_SECURITY_GROUP, createNetworkSecurityGroup.cloudOperation());
assertEquals("{\"tenantId\":\"my-tenant\",\"subscriptionId\":\"my-sub\",\"resourceGroupName\":\"my-rg\"," + "\"name\":\"my-nsg\",\"region\":\"eastus\"," + "\"rules\":[\"rule1\",\"rule2\"]}", createNetworkSecurityGroup.serialize().toString());
assertEquals(Optional.of(new CloudResourceUid().azureNetworkSecurityGroup(new AzureNetworkSecurityGroup().resourceGroup(azureResourceGroup(createNetworkSecurityGroup)).networkSecurityGroupName("my-nsg"))), createNetworkSecurityGroup.resourceUidCreation());
}
Aggregations