@Test(expected = KubernetesClientException.class) public void testCreateInvalidService() throws Exception { // create an invalid Service Service bogusServ = new Service(); bogusServ.setId("xxxxxx"); getClient().createService(bogusServ); }
private Service getService() { Service serv = new Service(); serv.setContainerPort("8379"); serv.setPort(5000); serv.setId("kubernetes-test-service"); serv.setLabels(ImmutableMap.of("name", "kubernetes-test-service-label")); serv.setName("kubernetes-test-service-name"); Selector selector = new Selector(); selector.setName(serv.getLabels().get("name")); serv.setSelector(selector); return serv; }