Interface TestPlugin


  • public interface TestPlugin
    Interface for implementing test plugins that can alter the behavior of tests run with SeedStack.
    • Method Detail

      • enabled

        boolean enabled​(TestContext testContext)
        This method should return true to enable the plugin or false to completely disable it.
        Parameters:
        testContext - the test context.
        Returns:
        true if the plugin should be enabled, false otherwise.
      • beforeLaunch

        default void beforeLaunch​(TestContext testContext)
        This method is executed before launching the SeedStack environment used for testing.
        Parameters:
        testContext - the test context.
      • afterShutdown

        default void afterShutdown​(TestContext testContext)
        This method is executed after shutting down the SeedStack environment used for testing.
        Parameters:
        testContext - the test context.
      • arguments

        default String[] arguments​(TestContext testContext)
        Allow the plugin to specify arguments used for launching the SeedStack environment used for testing.
        Parameters:
        testContext - the test context.
        Returns:
        the arguments used for launching the test environment.
      • configurationProperties

        default Map<String,​String> configurationProperties​(TestContext testContext)
        Allow the plugin to specify configuration properties for the SeedStack environment used for testing.
        Parameters:
        testContext - the test context.
        Returns:
        the configuration properties for the test environment.
      • expectedException

        default Optional<Class<? extends Exception>> expectedException​(TestContext testContext)
        Allow the plugin to specify the exception that is expected to be the outcome of the SeedStack environment launch.
        Parameters:
        testContext - the test context.
        Returns:
        the exception that is expected to be the outcome of the test environment launch.
      • launchMode

        default LaunchMode launchMode​(TestContext testContext)
        Allow the plugin to specify a particular LaunchMode for the test. The LaunchMode.ANY mode specifies that this plugin doesn't require a particular mode.
        Parameters:
        testContext - the test context.
        Returns:
        the launch mode to be used for the test environment.
      • launcher

        default Optional<? extends org.seedstack.seed.spi.SeedLauncher> launcher​(TestContext testContext)
        Allow the plugin to specify a particular SeedLauncher to be used to launch the SeedStack environment used for testing.
        Parameters:
        testContext - the test context.
        Returns:
        the SeedLauncher to be used to launch the test environment.
      • separateThread

        default boolean separateThread​(TestContext testContext)
        Allow the plugin to specify if the launch should occur in a separate thread or the main thread.
        Parameters:
        testContext - the test context.
        Returns:
        true if the launch should be done in a new thread, false if it should be done in the main thread.
      • kernelParameters

        default Map<String,​String> kernelParameters​(TestContext testContext)
        Allow the plugin to specify kernel parameters for the SeedStack environment used for testing.
        Parameters:
        testContext - the test context.
        Returns:
        the kernel parameters for the test environment.