use of io.fabric8.kubernetes.api.model.ServiceListBuilder in project carbon-apimgt by wso2.
the class ServiceDiscovererKubernetesTestCase method createMalformedServiceList.
/**
* Create ServiceList with the given port type, but without a loadBalancer ingress
*
* @param portType http or https or a wrong port to check behavior
* @return ServiceList containing one service of LoadBalancer type
*/
private ServiceList createMalformedServiceList(String portType) {
ServicePort port = new ServicePortBuilder().withName(portType).withPort(80).withNodePort(30005).build();
Service malformedService5 = new ServiceBuilder().withNewMetadata().withName("service5").withNamespace("prod").and().withNewSpec().withType("LoadBalancer").withClusterIP("1.1.1.5").withPorts(port).and().withNewStatus().withNewLoadBalancer().endLoadBalancer().and().build();
List<Service> servicesList = new ArrayList<>();
servicesList.add(malformedService5);
return new ServiceListBuilder().withItems(servicesList).build();
}
Aggregations