Skip to main content
Version: 10.x

ResolutionContext class

The ResolutionContext class provides the core mechanism for generating test data. While it is used internally by AutoParams, you can also instantiate and use it directly in your own test code when needed.

Here's an example:

@Test
void testMethod() {
ResolutionContext context = new ResolutionContext();
Product product = context.resolve();
Review review = context.resolve();
}

In this example, ResolutionContext is used to manually generate instances of Product and Review outside of the @AutoParams annotation. This offers more control and flexibility for writing custom test logic or handling special cases.