Class TestHelper


  • public class TestHelper
    extends Object
    Utility to interact with an application running in a container. It can be injected into your test, in which case it is pre-initialised with the container name for your application. Alternatively, you can call its static methods and specify the container and pod names.
    Author:
    Kabir Khan
    • Method Detail

      • getContainerName

        public String getContainerName()
      • waitUntilWildFlyIsReady

        public boolean waitUntilWildFlyIsReady​(long delay)
      • waitUntilWildFlyIsReady

        public static boolean waitUntilWildFlyIsReady​(io.fabric8.kubernetes.client.KubernetesClient k8sClient,
                                                      String podName,
                                                      String containerName,
                                                      long delay)
      • executeCLICommands

        public org.jboss.dmr.ModelNode executeCLICommands​(String... commands)
      • executeCLICommands

        public static org.jboss.dmr.ModelNode executeCLICommands​(io.fabric8.kubernetes.client.KubernetesClient client,
                                                                 String podName,
                                                                 String containerName,
                                                                 String... commands)
      • readFile

        public static String readFile​(io.fabric8.kubernetes.client.KubernetesClient client,
                                      String podName,
                                      String containerName,
                                      String filePath)
      • runCommand

        public String runCommand​(String bashCommand,
                                 boolean expectOutput)
      • runCommand

        public static String runCommand​(io.fabric8.kubernetes.client.KubernetesClient client,
                                        String podName,
                                        String containerName,
                                        String bashCommand,
                                        boolean expectOutput)
      • checkAndGetResult

        public static org.jboss.dmr.ModelNode checkAndGetResult​(org.jboss.dmr.ModelNode result)
      • checkFailed

        public static void checkFailed​(org.jboss.dmr.ModelNode result)