Add TestingTollgate which is a delegate of the Tollgate that which provides features for testing.
Introduce junit5 module
Add TollgateExtension which is a Extension that starts and stops the Tollgate following test lifecycle.
Results
Close #84
Users can use TestingTollgate in a unit test method by calling withTestingTollgate:
try (TestingTollgate tollgate = withTestingTollgate(builder -> {
// configure with the given builder
})) {
// do test
}
Users can use TollgateExtension with @RegisterExtension:
@RegisterExtension
static final TollgateExtension tollgate = new TollgateExtension() {
@Override
protected void configure(TollgateBuilder builder) {
// configure with the given builder
}
};
Migrate existing tests to use withTestingTollgate and TollgateExtension.
Motivation
84
Description
testing
moduleTestingTollgate
which is a delegate of theTollgate
that which provides features for testing.junit5
moduleTollgateExtension
which is aExtension
that starts and stops theTollgate
following test lifecycle.Results
TestingTollgate
in a unit test method by callingwithTestingTollgate
:TollgateExtension
with@RegisterExtension
:withTestingTollgate
andTollgateExtension
.