Search in sources :

Example 11 with GatewayV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request 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());
}
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 12 with GatewayV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request 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 13 with GatewayV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request 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 14 with GatewayV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request in project cloudbreak by hortonworks.

the class GatewayManifesterTest method getGatewayV4Request.

private GatewayV4Request getGatewayV4Request() {
    GatewayV4Request gatewayV4Request = new GatewayV4Request();
    GatewayTopologyV4Request gatewayTopologyV4Request = new GatewayTopologyV4Request();
    gatewayTopologyV4Request.setTopologyName("soo-deep");
    gatewayTopologyV4Request.setExposedServices(List.of("ALL"));
    gatewayV4Request.setSsoType(SSOType.SSO_PROVIDER);
    gatewayV4Request.setTopologies(List.of(gatewayTopologyV4Request));
    return gatewayV4Request;
}
Also used : GatewayV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request) GatewayTopologyV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.topology.GatewayTopologyV4Request)

Example 15 with GatewayV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request in project cloudbreak by hortonworks.

the class GatewayManifesterTest method prepareGatewayWhenRequestedHasValueForGatewayShouldReturnWithoutModifications.

@Test
void prepareGatewayWhenRequestedHasValueForGatewayShouldReturnWithoutModifications() {
    GatewayV4Request gatewayV4Request = getGatewayV4Request();
    StackV4Request stackV4Request = new StackV4Request();
    stackV4Request.setCluster(new ClusterV4Request());
    stackV4Request.getCluster().setGateway(gatewayV4Request);
    underTest.configureGatewayForSdxCluster(stackV4Request);
    isTrue(stackV4Request.getCluster().getGateway().equals(gatewayV4Request));
}
Also used : GatewayV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request) ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) StackV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request) Test(org.junit.jupiter.api.Test)

Aggregations

GatewayV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request)27 Test (org.junit.Test)15 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)13 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)7 Test (org.junit.jupiter.api.Test)6 GatewayTopologyV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.topology.GatewayTopologyV4Request)5 StackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)4 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)4 GatewayTopology (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.GatewayTopology)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)1 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1