Class LocalstackTestRunner

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

    public class LocalstackTestRunner
    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\docker.exe, C:\program files\docker\docker\resources\docker.exe, usr/local/bin/docker or usr/bin/docker) 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, Waldemar Hummer
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalstackTestRunner​(java.lang.Class<?> klass)  
    • Method Summary

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

        collectInitializationErrors, computeTestMethods, createTest, 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, order, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
      • 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

      • LocalstackTestRunner

        public LocalstackTestRunner​(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>