CreatePodActionParser extends KubernetesExecuteActionParser<CreatePod> { public CreatePodActionParser() { super(CreatePod.class); } CreatePodActionParser();   }
@Test public void testCreatePodActionParser() { assertActionCount(2); assertActionClassAndName(KubernetesExecuteAction.class, "kubernetes-execute"); KubernetesExecuteAction action = getNextTestActionFromTest(); Assert.assertNotNull(action.getCommand()); Assert.assertEquals(action.getCommand().getClass(), CreatePod.class); Assert.assertEquals(action.getKubernetesClient().getClass(), KubernetesClient.class); Assert.assertEquals(action.getCommand().getParameters().size(), 0); Assert.assertEquals(((CreatePod) action.getCommand()).getTemplate(), "classpath:templates/hello-jetty.yml"); action = getNextTestActionFromTest(); Assert.assertNotNull(action.getCommand()); Assert.assertEquals(action.getCommand().getClass(), CreatePod.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), "myPod"); Assert.assertEquals(action.getCommand().getParameters().get(KubernetesMessageHeaders.NAMESPACE), "default"); Assert.assertEquals(action.getCommand().getParameters().get(KubernetesMessageHeaders.LABEL), "pod=new"); Assert.assertNull(((CreatePod) action.getCommand()).getTemplate()); Assert.assertEquals(((CreatePod) action.getCommand()).getImage(), "busybox:latest"); Assert.assertEquals(((CreatePod) action.getCommand()).getContainerName(), "myContainer"); Assert.assertEquals(((CreatePod) action.getCommand()).getContainerPort(), "8080"); Assert.assertEquals(((CreatePod) action.getCommand()).getProtocol(), "TCP"); Assert.assertEquals(((CreatePod) action.getCommand()).getPullPolicy(), "Always"); Assert.assertEquals(((CreatePod) action.getCommand()).getRestartPolicy(), "Always"); Assert.assertEquals(((CreatePod) action.getCommand()).getContainerCommand(), "exec"); }