use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ClusterRequestToClusterConverterTest method testConvertWithFileSystemDetails.
@Test
public void testConvertWithFileSystemDetails() {
// GIVEN
given(conversionService.convert(any(KerberosRequest.class), eq(KerberosConfig.class))).willReturn(new KerberosConfig());
given(conversionService.convert(any(FileSystemRequest.class), eq(FileSystem.class))).willReturn(new FileSystem());
// WHEN
Cluster result = underTest.convert(getRequest("stack/cluster-with-file-system.json"));
// THEN
assertAllFieldsNotNull(result, Arrays.asList("stack", "blueprint", "creationStarted", "creationFinished", "upSince", "statusReason", "ambariIp", "ambariStackDetails", "certDir", "rdsConfigs", "ldapConfig", "attributes", "blueprintCustomProperties", "uptime", "ambariSecurityMasterKey", "proxyConfig", "extendedBlueprintText"));
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ClusterRequestToClusterConverterTest method testConvert.
@Test
public void testConvert() {
// GIVEN
// WHEN
Cluster result = underTest.convert(getRequest("stack/cluster.json"));
// THEN
assertAllFieldsNotNull(result, Arrays.asList("stack", "blueprint", "creationStarted", "creationFinished", "upSince", "statusReason", "ambariIp", "ambariStackDetails", "fileSystem", "certDir", "rdsConfigs", "ldapConfig", "attributes", "blueprintCustomProperties", "uptime", "kerberosConfig", "ambariSecurityMasterKey", "proxyConfig", "extendedBlueprintText"));
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ClusterToClusterResponseConverterTest method createSource.
@Override
public Cluster createSource() {
Stack stack = TestUtil.stack();
Blueprint blueprint = TestUtil.blueprint();
Cluster cluster = TestUtil.cluster(blueprint, stack, 1L);
ProxyConfig proxyConfig = new ProxyConfig();
proxyConfig.setName("test");
cluster.setProxyConfig(proxyConfig);
stack.setCluster(cluster);
return cluster;
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class StackCreatorService method createClusterIfNeed.
private void createClusterIfNeed(IdentityUser user, StackRequest stackRequest, Stack stack, String stackName, Blueprint blueprint) throws Exception {
if (stackRequest.getClusterRequest() != null) {
try {
long start = System.currentTimeMillis();
Cluster cluster = clusterCreationService.prepare(stackRequest.getClusterRequest(), stack, blueprint, user);
LOGGER.info("Cluster object and its dependencies has been created in {} ms for stack {}", System.currentTimeMillis() - start, stackName);
stack.setCluster(cluster);
} catch (BadRequestException e) {
stackService.delete(stack);
throw e;
}
}
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ClusterCredentialChangeService method finishCredentialUpdate.
public void finishCredentialUpdate(Long stackId, Long clusterId, String password) {
Cluster cluster = clusterService.getById(clusterId);
cluster.setPassword(password);
finishCredentialChange(stackId, cluster);
}
Aggregations