I found a way to achieve this, but it seems rather clunky:
...
final List<Object> constructorArgs = new ArrayList<>();
try(MockedConstruction mocks = mockConstruction(SomeClass.class, (mock, context) -> {
constructorArgs.addAll(context.arguments());
})) {
new SomeClass("parameter1", "parameter2");
// iterate through constructorArgs performing assertions
}
...
Would the maintainers be open to adding first-class support somewhere in the API to get the constructor args used when the inline mock was injected?