use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ClusterProxyDecoratorTest method setUp.
@Before
public void setUp() {
when(mapper.mapRequestToEntity(any(ProxyConfigRequest.class), anyBoolean())).thenReturn(new ProxyConfig());
when(service.create(any(IdentityUser.class), any(ProxyConfig.class))).thenReturn(new ProxyConfig());
when(service.getPublicProxyConfig(anyString(), eq(identityUser))).thenReturn(new ProxyConfig());
cluster = new Cluster();
stack.setPublicInAccount(true);
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ClusterProxyDecoratorTest method testNothingProvided.
@Test
public void testNothingProvided() {
Cluster result = clusterProxyDecorator.prepareProxyConfig(cluster, identityUser, null, stack);
assertNull(result.getProxyConfig());
Mockito.verify(service, Mockito.times(0)).create(any(IdentityUser.class), any(ProxyConfig.class));
Mockito.verify(service, Mockito.times(0)).getPublicProxyConfig(anyString(), eq(identityUser));
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ClusterProxyDecoratorTest method testProxyNameProvided.
@Test
public void testProxyNameProvided() {
Cluster result = clusterProxyDecorator.prepareProxyConfig(cluster, identityUser, "test", stack);
assertNotNull(result.getProxyConfig());
Mockito.verify(service, Mockito.times(1)).getPublicProxyConfig(anyString(), eq(identityUser));
Mockito.verify(service, Mockito.times(0)).create(any(IdentityUser.class), any(ProxyConfig.class));
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class ProxyConfigProviderTest method init.
@Before
public void init() {
cluster = new Cluster();
servicePillar = new HashMap<>();
}
use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.
the class BlueprintTemplateProcessorTest method testMustacheGeneratorForHiveRDS.
@Test
public void testMustacheGeneratorForHiveRDS() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-mustache-test.bp");
Cluster cluster = cluster();
BlueprintStackInfo blueprintStackInfo = new BlueprintStackInfo("hdp", "2.4");
BlueprintPreparationObject blueprintPreparationObject = BlueprintPreparationObject.Builder.builder().withRdsConfigs(cluster.getRdsConfigs()).withGateway(cluster.getGateway()).withLdapConfig(cluster.getLdapConfig()).withGeneralClusterConfigs(generalClusterConfigs()).withBlueprintView(new BlueprintView(testBlueprint, blueprintStackInfo.getVersion(), blueprintStackInfo.getType())).build();
String result = underTest.process(testBlueprint, blueprintPreparationObject, Maps.newHashMap());
assertTrue(result.contains("\"javax.jdo.option.ConnectionURL\": \"jdbc:postgresql://10.1.1.1:5432/hive\""));
assertTrue(result.contains("\"javax.jdo.option.ConnectionUserName\": \"heyitsme\""));
assertTrue(result.contains("\"javax.jdo.option.ConnectionPassword\": \"iamsoosecure\""));
assertTrue(result.contains("\"javax.jdo.option.ConnectionDriverName\": \"org.postgresql.Driver\""));
assertTrue(result.contains("\"hive_database_type\": \"postgres\""));
assertTrue(result.contains("\"hive_database\": \"Existing postgresql Database\","));
}
Aggregations