use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class ClusterRequestToGatewayConverterTest method testConvertBasicProperties.
@Test
public void testConvertBasicProperties() {
GatewayV4Request source = new GatewayV4Request();
source.setPath(PATH);
source.setSsoProvider(SSO_PROVIDER);
source.setSsoType(SSOType.SSO_PROVIDER);
source.setTokenCert(TOKEN_CERT);
source.setGatewayType(GatewayType.CENTRAL);
source.setTopologies(getTopologies());
Gateway result = underTest.convert(source);
assertEquals(SSOType.SSO_PROVIDER, result.getSsoType());
assertEquals(TOKEN_CERT, result.getTokenCert());
assertEquals(GatewayType.CENTRAL, result.getGatewayType());
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class ClusterRequestToGatewayConverterTest method testWithEnableFalseAndDefinedTopologyInList.
@Test
public void testWithEnableFalseAndDefinedTopologyInList() {
GatewayV4Request source = new GatewayV4Request();
source.setTopologies(getTopologies());
Gateway result = underTest.convert(source);
assertNotNull(result);
assertEquals("topologyName", result.getTopologies().iterator().next().getTopologyName());
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class TestUtil method gatewayEnabled.
public static Gateway gatewayEnabled() {
Gateway gateway = new Gateway();
setGatewayTopology(gateway);
gateway.setPath("/path");
gateway.setSsoProvider("simple");
gateway.setSsoType(SSOType.SSO_PROVIDER);
gateway.setGatewayType(GatewayType.CENTRAL);
gateway.setSignCert("signcert");
gateway.setSignKey("signkey");
gateway.setTokenCert("tokencert");
gateway.setSignPub("signpub");
return gateway;
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class TestUtil method cluster.
public static Cluster cluster(Blueprint blueprint, Stack stack, Long id) {
Cluster cluster = new Cluster();
cluster.setClusterManagerIp("50.51.52.100");
cluster.setStack(stack);
cluster.setId(id);
cluster.setName("dummyCluster");
cluster.setClusterManagerIp("10.0.0.1");
cluster.setBlueprint(blueprint);
cluster.setUpSince(new Date().getTime());
cluster.setUserName("admin");
cluster.setPassword("admin");
Gateway gateway = new Gateway();
setGatewayTopology(gateway, "cb");
cluster.setGateway(gateway);
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setId(generateUniqueId());
Set<RDSConfig> rdsConfigs = new HashSet<>();
rdsConfigs.add(rdsConfig);
cluster.setRdsConfigs(rdsConfigs);
cluster.setHostGroups(hostGroups(cluster));
cluster.setConfigStrategy(ConfigStrategy.ALWAYS_APPLY_DONT_OVERRIDE_CUSTOM_VALUES);
Map<String, String> map = new HashMap<>();
try {
cluster.setAttributes(new Json(map).getValue());
} catch (IllegalArgumentException ignored) {
}
Workspace workspace = new Workspace();
workspace.setName("org 1");
workspace.setId(1L);
cluster.setWorkspace(workspace);
cluster.setDatabaseServerCrn("databaseCRN");
return cluster;
}
use of com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway in project cloudbreak by hortonworks.
the class TestUtil method gatewayEnabledWithoutSSOAndWithRanger.
public static Gateway gatewayEnabledWithoutSSOAndWithRanger() {
Gateway gateway = new Gateway();
setGatewayTopology(gateway);
gateway.setPath("/path");
gateway.setSsoType(SSOType.NONE);
gateway.setGatewayType(GatewayType.CENTRAL);
gateway.setSignCert("signcert");
gateway.setSignKey("signkey");
gateway.setTokenCert("tokencert");
gateway.setSignPub("signpub");
return gateway;
}
Aggregations