Class TestScenario


  • public final class TestScenario
    extends java.lang.Object
    Defines a HTTP Server Test Scenario.
    Since:
    3.8.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TestScenario.Builder
      Test Scenario Builder.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void asserts​(java.lang.String specName, io.micronaut.http.HttpRequest<?> request, java.util.function.BiConsumer<ServerUnderTest,​io.micronaut.http.HttpRequest<?>> assertion)  
      static void asserts​(java.lang.String specName, java.util.Map<java.lang.String,​java.lang.Object> configuration, io.micronaut.http.HttpRequest<?> request, java.util.function.BiConsumer<ServerUnderTest,​io.micronaut.http.HttpRequest<?>> assertion)  
      static void asserts​(java.lang.String specName, java.util.Map<java.lang.String,​java.lang.Object> configuration, RequestSupplier request, java.util.function.BiConsumer<ServerUnderTest,​io.micronaut.http.HttpRequest<?>> assertion)  
      static TestScenario.Builder builder()  
      • Methods inherited from class java.lang.Object

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

      • asserts

        public static void asserts​(java.lang.String specName,
                                   java.util.Map<java.lang.String,​java.lang.Object> configuration,
                                   io.micronaut.http.HttpRequest<?> request,
                                   java.util.function.BiConsumer<ServerUnderTest,​io.micronaut.http.HttpRequest<?>> assertion)
                            throws java.io.IOException
        Parameters:
        specName - Value for spec.name property. Used to avoid bean pollution.
        configuration - Test Scenario configuration
        request - HTTP Request to be sent in the test scenario
        assertion - Assertion for a request and server.
        Throws:
        java.io.IOException - Exception thrown while getting the server under test.
      • asserts

        public static void asserts​(java.lang.String specName,
                                   java.util.Map<java.lang.String,​java.lang.Object> configuration,
                                   RequestSupplier request,
                                   java.util.function.BiConsumer<ServerUnderTest,​io.micronaut.http.HttpRequest<?>> assertion)
                            throws java.io.IOException
        Parameters:
        specName - Value for spec.name property. Used to avoid bean pollution.
        configuration - Test Scenario configuration
        request - HTTP Request to be sent in the test scenario
        assertion - Assertion for a request and server.
        Throws:
        java.io.IOException - Exception thrown while getting the server under test.
      • asserts

        public static void asserts​(java.lang.String specName,
                                   io.micronaut.http.HttpRequest<?> request,
                                   java.util.function.BiConsumer<ServerUnderTest,​io.micronaut.http.HttpRequest<?>> assertion)
                            throws java.io.IOException
        Parameters:
        specName - Value for spec.name property. Used to avoid bean pollution.
        request - HTTP Request to be sent in the test scenario
        assertion - Assertion for a request and server.
        Throws:
        java.io.IOException - Exception thrown while getting the server under test.