Class LocalstackDockerTestRunner

  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

    public class LocalstackDockerTestRunner
    extends org.junit.runners.BlockJUnit4ClassRunner
    JUnit test runner that automatically pulls and runs the latest localstack docker image and then terminates when tests are complete. Having docker installed is a prerequisite for this test runner to execute. If docker is not installed in one of the default locations (C:\program files\docker\docker\resources\bin\, usr/local/bin or usr/bin) then use the DOCKER_LOCATION environment variable to specify the location. Since ports are dynamically allocated, the external port needs to be resolved based on the default localstack port. The hostname defaults to localhost, but in some environments that is not sufficient, so the HostName can be specified by using the LocalstackDockerProperties annotation with an IHostNameResolver.
    Author:
    Alan Bevier, Patrick Allain
    • Method Summary

      Modifier and Type Method Description
      void run​(org.junit.runner.notification.RunNotifier notifier)  
      • Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

        collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
      • Methods inherited from class org.junit.runners.ParentRunner

        childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
      • Methods inherited from class org.junit.runner.Runner

        testCount
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalstackDockerTestRunner

        public LocalstackDockerTestRunner​(java.lang.Class<?> klass)
                                   throws org.junit.runners.model.InitializationError
        Throws:
        org.junit.runners.model.InitializationError
    • Method Detail

      • run

        public void run​(org.junit.runner.notification.RunNotifier notifier)
        Overrides:
        run in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>