A Junit 5 extension that introduces a "Scenario Builder" to your tests giving you the following benefits:
- Test scenarios are very easy to define, using a builder-like fluent API
- Tests are more readable and easy to understand
- Reduces the general maintenance effort
- Getting started
- Entity References
- Builder Part ordering
- Cleanup after test execution
- Custom Scenario Builder
Here's a simple example how a "login" test could look like:
@Test
public void testLogin() {
// Prepare test scenario by creating a user
scenarioBuilder.build(scenario -> scenario
.withUser(user -> user
.withUsername("Christian")
.withPassword("MySecretPassword")
)
);
// ... Call login endpoint
// ... Assert that login was successful
}
See more examples in the test folder.