CreateServiceActionParser extends KubernetesExecuteActionParser<CreateService> { public CreateServiceActionParser() { super(CreateService.class); } CreateServiceActionParser();   }
@Test public void testCreateServiceActionParser() { assertActionCount(2); assertActionClassAndName(KubernetesExecuteAction.class, "kubernetes-execute"); KubernetesExecuteAction action = getNextTestActionFromTest(); Assert.assertNotNull(action.getCommand()); Assert.assertEquals(action.getCommand().getClass(), CreateService.class); Assert.assertEquals(action.getKubernetesClient().getClass(), KubernetesClient.class); Assert.assertEquals(action.getCommand().getParameters().size(), 0); Assert.assertEquals(((CreateService) action.getCommand()).getTemplate(), "classpath:templates/hello-jetty-service.yml"); action = getNextTestActionFromTest(); Assert.assertNotNull(action.getCommand()); Assert.assertEquals(action.getCommand().getClass(), CreateService.class); Assert.assertEquals(action.getKubernetesClient(), beanDefinitionContext.getBean("myK8sClient", KubernetesClient.class)); Assert.assertEquals(action.getCommand().getParameters().size(), 3); Assert.assertEquals(action.getCommand().getParameters().get(KubernetesMessageHeaders.NAME), "myService"); Assert.assertEquals(action.getCommand().getParameters().get(KubernetesMessageHeaders.NAMESPACE), "default"); Assert.assertEquals(action.getCommand().getParameters().get(KubernetesMessageHeaders.LABEL), "service=new"); Assert.assertNull(((CreateService) action.getCommand()).getTemplate()); Assert.assertEquals(((CreateService) action.getCommand()).getPort(), "8080"); Assert.assertEquals(((CreateService) action.getCommand()).getTargetPort(), "8080"); Assert.assertEquals(((CreateService) action.getCommand()).getNodePort(), "31234"); Assert.assertEquals(((CreateService) action.getCommand()).getProtocol(), "TCP"); Assert.assertEquals(((CreateService) action.getCommand()).getSelector(), "app=myApp"); }