Search in sources :

Example 6 with AzureCloudProvider

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

the class VmTypeTests method testAzureDefaultVMTypeForCredentialInDefaultRegion.

@Test(priority = 9, groups = "vmtypes")
public void testAzureDefaultVMTypeForCredentialInDefaultRegion() throws Exception {
    AzureCloudProvider provider = new AzureCloudProvider(getTestParameter());
    given(CloudbreakClient.isCreated());
    given(provider.aValidCredential().withName(AZURE_CRED_NAME), "Azure credential is created");
    given(VmType.request().withPlatform(provider.getPlatform()).withRegion(provider.region()).withAvailabilityZone(provider.availabilityZone()), "Azure vm type request");
    when(VmType.getPlatformVmTypes(), "vm types are requested to Azure credential and " + provider.region() + " region.");
    then(VmType.assertThis((vmtype, t) -> {
        String regionDefVirtualMachine = vmtype.getResponse().getVmTypes().get(provider.region()).getDefaultVirtualMachine().getValue();
        LOGGER.info("Azure Default Virtual Machine in {} region is ::: {}", provider.region(), regionDefVirtualMachine);
        Assert.assertNotNull(regionDefVirtualMachine, "Azure Default Virtual Machine should be present in response for default region!");
    }), "Default Virtual Machine should 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) ForbiddenException(javax.ws.rs.ForbiddenException) CloudbreakClient(com.sequenceiq.it.cloudbreak.newway.CloudbreakClient) AwsCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) Test(org.testng.annotations.Test) Credential(com.sequenceiq.it.cloudbreak.newway.Credential) GcpCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider) VmType(com.sequenceiq.it.cloudbreak.newway.VmType) 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) VmTypeJson(com.sequenceiq.cloudbreak.api.model.VmTypeJson) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)

Example 7 with AzureCloudProvider

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

the class DiskTypeTests method testListAzureDiskTypes.

@Test(priority = 15, groups = "disktypes")
public void testListAzureDiskTypes() throws Exception {
    AzureCloudProvider provider = new AzureCloudProvider(getTestParameter());
    given(CloudbreakClient.isCreated());
    given(DiskTypes.request().withType(provider.getPlatform()), provider.getPlatform() + " disk types request");
    when(DiskTypes.getByType(), provider.getPlatform() + " disk types are requested.");
    then(DiskTypes.assertThis((disktype, t) -> {
        Collection<String> diskTypes = disktype.getByFilterResponses();
        diskTypes.forEach((diskType) -> LOGGER.debug(provider.getPlatform() + " Disk Type is ::: {}", diskType));
        Assert.assertFalse(diskTypes.isEmpty(), "Disk Type should be present in response!");
    }), provider.getPlatform() + " Disk Type should 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) CloudbreakClient(com.sequenceiq.it.cloudbreak.newway.CloudbreakClient) AwsCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider) Collection(java.util.Collection) LoggerFactory(org.slf4j.LoggerFactory) DiskTypes(com.sequenceiq.it.cloudbreak.newway.DiskTypes) Test(org.testng.annotations.Test) GcpCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider) Objects(java.util.Objects) Assert(org.testng.Assert) AzureCloudProvider(com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider) Map(java.util.Map) Entry(java.util.Map.Entry) 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) CloudbreakTest(com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)

Example 8 with AzureCloudProvider

use of com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider 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

CloudbreakTest (com.sequenceiq.it.cloudbreak.newway.CloudbreakTest)8 AzureCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.AzureCloudProvider)8 Test (org.testng.annotations.Test)8 CloudbreakClient (com.sequenceiq.it.cloudbreak.newway.CloudbreakClient)5 TestParameter (com.sequenceiq.it.cloudbreak.newway.TestParameter)5 AwsCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.AwsCloudProvider)5 CloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.CloudProvider)5 GcpCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.GcpCloudProvider)5 OpenstackCloudProvider (com.sequenceiq.it.cloudbreak.newway.cloud.OpenstackCloudProvider)5 Logger (org.slf4j.Logger)5 LoggerFactory (org.slf4j.LoggerFactory)5 Assert (org.testng.Assert)5 Credential (com.sequenceiq.it.cloudbreak.newway.Credential)4 BadRequestException (javax.ws.rs.BadRequestException)4 ForbiddenException (javax.ws.rs.ForbiddenException)4 AfterTest (org.testng.annotations.AfterTest)4 VmTypeJson (com.sequenceiq.cloudbreak.api.model.VmTypeJson)3 VmType (com.sequenceiq.it.cloudbreak.newway.VmType)3 Set (java.util.Set)3 Collection (java.util.Collection)2