use of com.sequenceiq.cloudbreak.api.model.CloudGatewayJson in project cloudbreak by hortonworks.
the class Gateway method assertValidGateways.
public static Assertion<Gateway> assertValidGateways() {
return assertThis((gateway, t) -> {
if (gateway.getResponse().isEmpty()) {
LOGGER.info("No gateways for given provider");
} else {
for (Map.Entry<String, Set<CloudGatewayJson>> elem : gateway.getResponse().entrySet()) {
for (Object response : elem.getValue()) {
CloudGatewayJson gatewayJson = (CloudGatewayJson) response;
Assert.assertFalse(gatewayJson.getName().isEmpty());
}
}
}
});
}
use of com.sequenceiq.cloudbreak.api.model.CloudGatewayJson in project cloudbreak by hortonworks.
the class CloudGatewayssToPlatformGatewaysResponseConverter method convert.
@Override
public PlatformGatewaysResponse convert(CloudGateWays source) {
Map<String, Set<CloudGatewayJson>> result = new HashMap<>();
for (Entry<String, Set<CloudGateWay>> entry : source.getCloudGateWayResponses().entrySet()) {
Set<CloudGatewayJson> cloudGatewayJsons = new HashSet<>();
for (CloudGateWay gateway : entry.getValue()) {
CloudGatewayJson actual = new CloudGatewayJson(gateway.getName(), gateway.getId(), gateway.getProperties());
cloudGatewayJsons.add(actual);
}
result.put(entry.getKey(), cloudGatewayJsons);
}
return new PlatformGatewaysResponse(result);
}
Aggregations