use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request in project cloudbreak by hortonworks.
the class GatewayConvertUtilTest method testGatewayPathConversionWhenNoPathInGatewayJson.
@Test
public void testGatewayPathConversionWhenNoPathInGatewayJson() {
Gateway gateway = new Gateway();
GatewayV4Request gatewayJson = new GatewayV4Request();
underTest.setGatewayPathAndSsoProvider(gatewayJson, gateway);
assertEquals('/' + gateway.getPath() + "/sso/api/v1/websso", gateway.getSsoProvider());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request in project cloudbreak by hortonworks.
the class GatewayV4RequestValidatorTest method testValidationWithNameDuplicates.
@Test
public void testValidationWithNameDuplicates() {
GatewayV4Request gatewayJson = new GatewayV4Request();
GatewayTopologyV4Request topology1 = new GatewayTopologyV4Request();
topology1.setTopologyName("Apple");
GatewayTopologyV4Request topology2 = new GatewayTopologyV4Request();
topology2.setTopologyName("Apple");
GatewayTopologyV4Request topology3 = new GatewayTopologyV4Request();
topology3.setTopologyName("Banana");
gatewayJson.setTopologies(Arrays.asList(topology1, topology2, topology3));
ValidationResult result = underTest.validate(gatewayJson);
assertEquals(State.ERROR, result.getState());
assertTrue(result.getFormattedErrors().contains("Apple"));
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request in project cloudbreak by hortonworks.
the class GatewayV4RequestValidatorTest method testValidationWithoutNameDuplicates.
@Test
public void testValidationWithoutNameDuplicates() {
GatewayV4Request gatewayJsonV4Request = new GatewayV4Request();
GatewayTopologyV4Request topology1 = new GatewayTopologyV4Request();
topology1.setTopologyName("Apple");
GatewayTopologyV4Request topology2 = new GatewayTopologyV4Request();
topology2.setTopologyName("Banana");
GatewayTopologyV4Request topology3 = new GatewayTopologyV4Request();
topology3.setTopologyName("Citrone");
gatewayJsonV4Request.setTopologies(Arrays.asList(topology1, topology2, topology3));
ValidationResult result = underTest.validate(gatewayJsonV4Request);
assertEquals(State.VALID, result.getState());
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request in project cloudbreak by hortonworks.
the class GatewayV1ToGatewayV4Converter method convert.
public GatewayV4Request convert(List<String> exposedServices) {
GatewayV4Request gatewayV4Request = new GatewayV4Request();
gatewayV4Request.setTopologies(getIfNotNull(exposedServices, this::topologies));
gatewayV4Request.setSsoType(ssoType);
return gatewayV4Request;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.GatewayV4Request in project cloudbreak by hortonworks.
the class StackV4RequestToGatewayConverterTest method generateStackV4Request.
private StackV4Request generateStackV4Request(GatewayV4Request gateWayJson) {
ClusterV4Request clusterRequest = new ClusterV4Request();
clusterRequest.setGateway(gateWayJson);
StackV4Request source = new StackV4Request();
source.setName("funnyCluster");
source.setCluster(clusterRequest);
return source;
}
Aggregations