Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate specified Assertions #28

Open
ddidier opened this issue Nov 27, 2015 · 1 comment
Open

Aggregate specified Assertions #28

ddidier opened this issue Nov 27, 2015 · 1 comment

Comments

@ddidier
Copy link

ddidier commented Nov 27, 2015

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.

@joel-costigliola
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants