Search in sources :

Example 6 with NetworkResourcesCreationRequest

use of com.sequenceiq.cloudbreak.cloud.model.network.NetworkResourcesCreationRequest in project cloudbreak by hortonworks.

the class AzureNetworkConnectorTest method testCreateProviderSpecificNetworkResourcesWhenPrivateEndpoint.

@Test
public void testCreateProviderSpecificNetworkResourcesWhenPrivateEndpoint() {
    NetworkResourcesCreationRequest request = createProviderSpecificNetworkResources(true);
    AuthenticatedContext authenticatedContext = new AuthenticatedContext(request.getCloudContext(), request.getCloudCredential());
    when(azureClientService.getClient(request.getCloudCredential())).thenReturn(azureClient);
    underTest.createProviderSpecificNetworkResources(request);
    verify(azureDnsZoneService).checkOrCreateDnsZones(authenticatedContext, azureClient, getNetworkView(), RESOURCE_GROUP, getTags(), Set.of(AzurePrivateDnsZoneServiceEnum.POSTGRES));
    verify(azureNetworkLinkService).checkOrCreateNetworkLinks(authenticatedContext, azureClient, getNetworkView(), RESOURCE_GROUP, getTags(), Set.of(AzurePrivateDnsZoneServiceEnum.POSTGRES));
}
Also used : NetworkResourcesCreationRequest(com.sequenceiq.cloudbreak.cloud.model.network.NetworkResourcesCreationRequest) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Test(org.junit.Test)

Example 7 with NetworkResourcesCreationRequest

use of com.sequenceiq.cloudbreak.cloud.model.network.NetworkResourcesCreationRequest in project cloudbreak by hortonworks.

the class AzureNetworkConnectorTest method testCreateProviderSpecificNetworkResourcesShouldRun.

@Test
public void testCreateProviderSpecificNetworkResourcesShouldRun() {
    NetworkResourcesCreationRequest request = createProviderSpecificNetworkResources();
    AuthenticatedContext authenticatedContext = new AuthenticatedContext(request.getCloudContext(), request.getCloudCredential());
    when(azureClientService.getClient(request.getCloudCredential())).thenReturn(azureClient);
    underTest.createProviderSpecificNetworkResources(request);
    verify(azureDnsZoneService).checkOrCreateDnsZones(authenticatedContext, azureClient, getNetworkView(), RESOURCE_GROUP, getTags());
    verify(azureNetworkLinkService).checkOrCreateNetworkLinks(authenticatedContext, azureClient, getNetworkView(), RESOURCE_GROUP, getTags());
}
Also used : NetworkResourcesCreationRequest(com.sequenceiq.cloudbreak.cloud.model.network.NetworkResourcesCreationRequest) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Test(org.junit.Test)

Aggregations

NetworkResourcesCreationRequest (com.sequenceiq.cloudbreak.cloud.model.network.NetworkResourcesCreationRequest)7 Test (org.junit.Test)3 AuthenticatedContext (com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext)2 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)2 BaseNetwork (com.sequenceiq.environment.network.dao.domain.BaseNetwork)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 NetworkConnector (com.sequenceiq.cloudbreak.cloud.NetworkConnector)1 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)1 CloudPlatformVariant (com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant)1 NetworkDto (com.sequenceiq.environment.network.dto.NetworkDto)1 AzureEnvironmentNetworkConverter (com.sequenceiq.environment.network.v1.converter.AzureEnvironmentNetworkConverter)1 HashSet (java.util.HashSet)1 Test (org.junit.jupiter.api.Test)1 EnumSource (org.junit.jupiter.params.provider.EnumSource)1