use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.
the class NetworkRequestToDtoConverterTest method createMockParams.
private EnvironmentNetworkMockParams createMockParams() {
EnvironmentNetworkMockParams mockParams = new EnvironmentNetworkMockParams();
mockParams.setInternetGatewayId("internet-gateway-id");
mockParams.setVpcId(NETWORK_ID);
return mockParams;
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.
the class RedbeamsDatabaseServerTest method createRedbeamsDatabaseServerTest.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a prepared database", when = "when a database create request is sent with the same database name", then = "the create should return a BadRequestException")
public void createRedbeamsDatabaseServerTest(MockedTestContext testContext) {
String databaseName = resourcePropertyProvider().getName();
String networkKey = "someOtherNetwork";
String clusterCrn = TestCrnGenerator.getDatalakeCrn(UUID.randomUUID().toString(), "cloudera");
testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(EnvironmentTestDto.class).withNetwork(networkKey).withCreateFreeIpa(Boolean.FALSE).withName(resourcePropertyProvider().getEnvironmentName()).when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(RedbeamsDatabaseServerTestDto.class).withName(databaseName).withClusterCrn(clusterCrn).when(redbeamsDatabaseServerTest.createV4()).await(Status.AVAILABLE).when(redbeamsDatabaseServerTest.deleteV4()).await(Status.DELETE_COMPLETED).validate();
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.
the class MockSdxTests method testDefaultSDXCanBeCreatedThenDeletedSuccessfully.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running Cloudbreak", when = "a valid SDX Internal Create request is sent", then = "SDX should be available AND deletable")
public void testDefaultSDXCanBeCreatedThenDeletedSuccessfully(MockedTestContext testContext) {
String sdxInternal = resourcePropertyProvider().getName();
String networkKey = "someNetwork";
testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(EnvironmentTestDto.class).withNetwork(networkKey).withCreateFreeIpa(Boolean.FALSE).withName(resourcePropertyProvider().getEnvironmentName()).when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(sdxInternal, SdxInternalTestDto.class).when(sdxTestClient.createInternal(), key(sdxInternal)).await(SdxClusterStatusResponse.RUNNING, key(sdxInternal)).then((tc, testDto, client) -> sdxTestClient.deleteInternal().action(tc, testDto, client)).await(SdxClusterStatusResponse.DELETED, key(sdxInternal)).validate();
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.
the class MockSdxUpgradeTests method testSdxUpgradeAfterResize.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "there is a running Cloudbreak", when = "start an sdx cluster without attached disk on gateway, but disk attachment is supported on cloud provider side", then = "Upgrade option should be presented")
public void testSdxUpgradeAfterResize(MockedTestContext testContext) {
String upgradeImageCatalogName = resourcePropertyProvider().getName();
createImageCatalogForOsUpgrade(testContext, upgradeImageCatalogName);
String sdxInternal = resourcePropertyProvider().getName();
String stack = resourcePropertyProvider().getName();
String cluster = "cmcluster";
String imageSettings = "imageSettingsUpgrade";
String networkKey = "someOtherNetwork";
testContext.given(networkKey, EnvironmentNetworkTestDto.class).withMock(new EnvironmentNetworkMockParams()).given(EnvironmentTestDto.class).withNetwork(networkKey).withCreateFreeIpa(Boolean.TRUE).withName(resourcePropertyProvider().getEnvironmentName()).withBackup("location/of/the/backup").when(getEnvironmentTestClient().create()).await(EnvironmentStatus.AVAILABLE).given(FreeIpaTestDto.class).when(freeIpaTestClient.create()).await(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.Status.AVAILABLE).given(cluster, ClusterTestDto.class).given(imageSettings, ImageSettingsTestDto.class).withImageId("aaa778fc-7f17-4535-9021-515351df3691").withImageCatalog(upgradeImageCatalogName).given("NoAttachedDisksTemplate", InstanceTemplateV4TestDto.class).withAttachedVolume(testContext.init(VolumeV4TestDto.class).withCount(0)).given("InstanceGroupWithoutAttachedDisk", InstanceGroupTestDto.class).withHostGroup(HostGroupType.MASTER).withTemplate("NoAttachedDisksTemplate").given(stack, StackTestDto.class).withCluster(cluster).withImageSettings(imageSettings).replaceInstanceGroups("InstanceGroupWithoutAttachedDisk").given(sdxInternal, SdxInternalTestDto.class).withStackRequest(key(cluster), key(stack)).when(sdxTestClient.createInternal(), key(sdxInternal)).await(SdxClusterStatusResponse.RUNNING).when(sdxTestClient.resize(), key(sdxInternal)).await(SdxClusterStatusResponse.STOP_IN_PROGRESS, key(sdxInternal).withWaitForFlow(Boolean.FALSE)).await(SdxClusterStatusResponse.STACK_CREATION_IN_PROGRESS, key(sdxInternal).withWaitForFlow(Boolean.FALSE)).await(SdxClusterStatusResponse.RUNNING, key(sdxInternal).withWaitForFlow(Boolean.FALSE)).withClusterShape(SdxClusterShape.MEDIUM_DUTY_HA).then(SdxUpgradeTestAssertion.validateSuccessfulUpgrade()).validate();
}
use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkMockParams in project cloudbreak by hortonworks.
the class NetworkV1ToNetworkV4ConverterTest method createEnvironmentNetworkMockParams.
private EnvironmentNetworkMockParams createEnvironmentNetworkMockParams() {
EnvironmentNetworkMockParams mockParams = new EnvironmentNetworkMockParams();
mockParams.setVpcId("someVpcId");
mockParams.setInternetGatewayId("someInternetGatewayId");
return mockParams;
}
Aggregations