assertj-assertions-generator-maven-plugin
assertj-assertions-generator-maven-plugin copied to clipboard
Aggregate specified Assertions
Enhancement
Use case:
- I have generated the assertions for my model
- I have created some custom assertions
- I'm still using the standard assertions
And I'd like to use a single "Assertions" class (entry point).
Configuration could be:
- the FQN of the aggregation class
- a list of packages containing Assert implementations
- a list of classes implementing Assert
- a list of includes to restrict classes to aggregate (regex)
- a list of excludes to exclude classes to aggregate (regex)
So basically the generator will copy all the model generated and custom
public static XxxxxAssert assertThat(Xxxxx actual) {
return new XxxxxAssert(actual);
}
into one class inheriting Assertions.
I would simply add your custom assertions assertThat
methods to the generated Assertions
and make it inherits from the standard Assertions
if you want a unique entry point for all your assertions.
Or you create an Assertions
class for your custom assertions, make it inherits from the generated Assertions
and change the template of generated Assertions
to inherit from standard Assertions
.