Search in sources :

Example 26 with Gateway

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());
}
Also used : GatewayV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request) Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway) Test(org.junit.Test)

Example 27 with Gateway

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());
}
Also used : GatewayV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request) Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway) Test(org.junit.Test)

Example 28 with Gateway

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;
}
Also used : Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)

Example 29 with 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;
}
Also used : HashMap(java.util.HashMap) Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) Json(com.sequenceiq.cloudbreak.common.json.Json) Date(java.util.Date) HashSet(java.util.HashSet) Workspace(com.sequenceiq.cloudbreak.workspace.model.Workspace)

Example 30 with Gateway

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;
}
Also used : Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)

Aggregations

Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)69 Test (org.junit.Test)30 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)20 HashSet (java.util.HashSet)17 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)15 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)15 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)15 GatewayV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request)13 ExposedService (com.sequenceiq.cloudbreak.api.service.ExposedService)12 GatewayTopology (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.GatewayTopology)12 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)11 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)11 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)10 IOException (java.io.IOException)10 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)8 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)8 ArrayList (java.util.ArrayList)8 Json (com.sequenceiq.cloudbreak.common.json.Json)7 IdBroker (com.sequenceiq.cloudbreak.domain.stack.cluster.IdBroker)7 ExposedServices (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.ExposedServices)7