Class TestScenario

java.lang.Object
io.micronaut.http.tck.TestScenario

public final class TestScenario extends Object
Defines a HTTP Server Test Scenario.
Since:
3.8.0
Author:
Sergio del Amo
  • Method Details

    • asserts

      public static void asserts(String specName, Map<String,Object> configuration, HttpRequest<?> request, BiConsumer<ServerUnderTest,HttpRequest<?>> assertion) throws 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:
      IOException - Exception thrown while getting the server under test.
    • asserts

      public static void asserts(String specName, Map<String,Object> configuration, RequestSupplier request, BiConsumer<ServerUnderTest,HttpRequest<?>> assertion) throws 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:
      IOException - Exception thrown while getting the server under test.
    • asserts

      public static void asserts(String specName, HttpRequest<?> request, BiConsumer<ServerUnderTest,HttpRequest<?>> assertion) throws 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:
      IOException - Exception thrown while getting the server under test.
    • builder

      public static TestScenario.Builder builder()
      Returns:
      A Test Scenario builder.