Package io.micronaut.http.server.tck
Class TestScenario.Builder
- java.lang.Object
-
- io.micronaut.http.server.tck.TestScenario.Builder
-
- Enclosing class:
- TestScenario
public static class TestScenario.Builder extends java.lang.Object
Test Scenario Builder.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TestScenario.Builder
assertion(java.util.function.BiConsumer<ServerUnderTest,io.micronaut.http.HttpRequest<?>> assertion)
TestScenario.Builder
configuration(java.util.Map<java.lang.String,java.lang.Object> configuration)
TestScenario.Builder
request(io.micronaut.http.HttpRequest<?> request)
TestScenario.Builder
request(RequestSupplier request)
void
run()
Runs the Test Scneario.TestScenario.Builder
specName(java.lang.String specName)
-
-
-
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.
-
-