use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class ClusterRequestToClusterConverterTest method testConvert.
@Test
public void testConvert() {
// GIVEN
ClusterV4Request request = getRequest("cluster.json");
Blueprint blueprint = new Blueprint();
blueprint.setStackType(StackType.HDP.name());
given(blueprintService.getByNameForWorkspaceAndLoadDefaultsIfNecessary(eq("my-blueprint"), any())).willReturn(blueprint);
given(gatewayV4RequestToGatewayConverter.convert(request.getGateway())).willReturn(new Gateway());
// WHEN
Cluster result = underTest.convert(request);
// THEN
assertAllFieldsNotNull(result, Arrays.asList("stack", "blueprint", "creationStarted", "creationFinished", "upSince", "statusReason", "clusterManagerIp", "fileSystem", "additionalFileSystem", "rdsConfigs", "attributes", "uptime", "ambariSecurityMasterKey", "proxyConfigCrn", "configStrategy", "extendedBlueprintText", "environmentCrn", "variant", "description", "databaseServerCrn", "fqdn", "customConfigurations"));
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class ClusterRequestToClusterConverterTest method testConvertWithCloudStorageDetails.
@Test
public void testConvertWithCloudStorageDetails() {
// GIVEN
ClusterV4Request request = getRequest("cluster-with-cloud-storage.json");
given(gatewayV4RequestToGatewayConverter.convert(request.getGateway())).willReturn(new Gateway());
given(cloudStorageConverter.requestToFileSystem(request.getCloudStorage())).willReturn(new FileSystem());
given(cloudStorageValidationUtil.isCloudStorageConfigured(request.getCloudStorage())).willReturn(true);
Blueprint blueprint = new Blueprint();
blueprint.setStackType(StackType.HDP.name());
given(blueprintService.getByNameForWorkspaceAndLoadDefaultsIfNecessary(eq("my-blueprint"), any())).willReturn(blueprint);
// WHEN
Cluster result = ThreadBasedUserCrnProvider.doAs(TEST_USER_CRN, () -> underTest.convert(request));
// THEN
assertAllFieldsNotNull(result, Arrays.asList("stack", "blueprint", "creationStarted", "creationFinished", "upSince", "statusReason", "clusterManagerIp", "additionalFileSystem", "rdsConfigs", "attributes", "uptime", "ambariSecurityMasterKey", "proxyConfigCrn", "extendedBlueprintText", "environmentCrn", "variant", "description", "databaseServerCrn", "fqdn", "configStrategy", "customConfigurations"));
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class ClusterToClusterV4ResponseConverterTest method createSource.
@Override
public Cluster createSource() {
Stack stack = TestUtil.stack();
Blueprint blueprint = TestUtil.blueprint();
Cluster cluster = TestUtil.cluster(blueprint, stack, 1L);
cluster.setProxyConfigCrn("test-CRN");
stack.setCluster(cluster);
Gateway gateway = new Gateway();
cluster.setGateway(gateway);
return cluster;
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class ClusterRequestToGatewayConverterTest method testConvertNewTopologies.
@Test
public void testConvertNewTopologies() {
GatewayV4Request source = new GatewayV4Request();
GatewayTopologyV4Request topology1 = new GatewayTopologyV4Request();
topology1.setTopologyName("topology1");
source.setTopologies(Collections.singletonList(topology1));
Gateway result = underTest.convert(source);
assertFalse(result.getTopologies().isEmpty());
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class ClusterRequestToGatewayConverterTest method testConvertSsoType.
@Test
public void testConvertSsoType() {
GatewayV4Request source = new GatewayV4Request();
source.setTopologies(getTopologies());
Gateway result = underTest.convert(source);
assertEquals(SSOType.NONE, result.getSsoType());
}
Aggregations