assertj-assertions-generator-maven-plugin icon indicating copy to clipboard operation
assertj-assertions-generator-maven-plugin copied to clipboard

Aggregate specified Assertions

Open ddidier opened this issue 9 years ago • 1 comments

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.

ddidier avatar Nov 27 '15 14:11 ddidier

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.

joel-costigliola avatar Nov 28 '15 20:11 joel-costigliola