use of io.fabric8.kubernetes.api.model.NodeBuilder in project flink by apache.
the class KubernetesClientTestBase method mockExpectedNodesFromServerSide.
protected void mockExpectedNodesFromServerSide(List<String> addresses) {
final List<Node> nodes = new ArrayList<>();
Collections.shuffle(addresses);
for (String address : addresses) {
final String[] parts = address.split(":");
Preconditions.checkState(parts.length == 2, "Address should be in format \"<type>:<ip>\".");
nodes.add(new NodeBuilder().withStatus(new NodeStatusBuilder().withAddresses(new NodeAddressBuilder().withType(parts[0]).withAddress(parts[1]).build()).build()).build());
}
server.expect().get().withPath("/api/v1/nodes").andReturn(200, new NodeListBuilder().withItems(nodes).build()).always();
}
Aggregations