Search in sources :

Example 1 with Region

use of com.sequenceiq.it.cloudbreak.newway.Region in project cloudbreak by hortonworks.

the class RegionProviderSpecTests method testAzureAvailabilityZoneSupport.

@Test(priority = 1, groups = "regions")
private void testAzureAvailabilityZoneSupport() throws Exception {
    AzureCloudProvider provider = new AzureCloudProvider(getTestParameter());
    given(CloudbreakClient.isCreated());
    given(provider.aValidCredential().withName(AZURE_CRED_NAME), "Azure credential is created");
    given(Region.request(), "Azure region request");
    when(Region.getPlatformRegions(), "Regions are requested to Azure credential");
    then(Region.assertThis((region, t) -> {
        Collection<String> availibilityZones = region.getRegionResponse().getAvailabilityZones().get(provider.region());
        LOGGER.info("Azure Default Region's Availibility Zone is not supported.");
        Assert.assertTrue(availibilityZones.isEmpty());
    }), "Azure Default Region Availibility Zones should not be part of the response.");
}
Also used : CloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider) TestParameter(com.sequenceiq.it.cloudbreak.newway.TestParameter) Logger(org.slf4j.Logger) Region(com.sequenceiq.it.cloudbreak.newway.Region) ForbiddenException(javax.ws.rs.ForbiddenException) CloudbreakClient(com.sequenceiq.it.cloudbreak.newway.CloudbreakClient) AwsCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider) Collection(java.util.Collection) LoggerFactory(org.slf4j.LoggerFactory) Test(org.testng.annotations.Test) Credential(com.sequenceiq.it.cloudbreak.newway.Credential) GcpCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider) AfterTest(org.testng.annotations.AfterTest) Assert(org.testng.Assert) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) BadRequestException(javax.ws.rs.BadRequestException) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest) OpenstackCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) Collection(java.util.Collection) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)

Aggregations

CloudbreakClient (com.sequenceiq.it.cloudbreak.newway.CloudbreakClient)1 CloudbreakTest (com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)1 Credential (com.sequenceiq.it.cloudbreak.newway.Credential)1 Region (com.sequenceiq.it.cloudbreak.newway.Region)1 TestParameter (com.sequenceiq.it.cloudbreak.newway.TestParameter)1 AwsCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider)1 AzureCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider)1 CloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider)1 GcpCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider)1 OpenstackCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider)1 Collection (java.util.Collection)1 BadRequestException (javax.ws.rs.BadRequestException)1 ForbiddenException (javax.ws.rs.ForbiddenException)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1 Assert (org.testng.Assert)1 AfterTest (org.testng.annotations.AfterTest)1 Test (org.testng.annotations.Test)1