Class TestScenario.Builder

  • Enclosing class:
    TestScenario

    public static class TestScenario.Builder
    extends java.lang.Object
    Test Scenario Builder.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • specName

        public TestScenario.Builder specName​(java.lang.String specName)
        Parameters:
        specName - Value for spec.name property. Used to avoid bean pollution.
        Returns:
        Test Scenario builder
      • request

        public TestScenario.Builder request​(io.micronaut.http.HttpRequest<?> request)
        Parameters:
        request - HTTP Request to be sent in the test scenario
        Returns:
        The Test Scneario Builder
      • request

        public TestScenario.Builder request​(RequestSupplier request)
        Parameters:
        request - HTTP Request supplier that given a server, provides the request to be sent in the test scenario
        Returns:
        The Test Scenario Builder
      • configuration

        public TestScenario.Builder configuration​(java.util.Map<java.lang.String,​java.lang.Object> configuration)
        Parameters:
        configuration - Test Scenario configuration
        Returns:
        Test scenario builder
      • assertion

        public TestScenario.Builder assertion​(java.util.function.BiConsumer<ServerUnderTest,​io.micronaut.http.HttpRequest<?>> assertion)
        Parameters:
        assertion - Assertion for a request and server.
        Returns:
        The Test Scenario Builder
      • run

        public void run()
                 throws java.io.IOException
        Runs the Test Scneario.
        Throws:
        java.io.IOException - Exception thrown while getting the server under test.