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

Assertions generated for some package uses its own assertThat methods for classes from this package #9

Closed
tomasz-luch-payu-gpo opened this issue Apr 18, 2014 · 2 comments

Comments

@tomasz-luch-payu-gpo
Copy link

Is it possible to use Assertions class generated by this maven plugin inside generated assertions in the same package?

f.e. If we have Cart class and Item class.

public class Cart {
private List items;
}

public class Item {
private String name;
private Integer quantity;
...
}

So method in CartAssert.assertThat(List items) uses ItemAssert for comparing items. Right now standard Assertions class is used.

@joel-costigliola
Copy link
Member

Hi,

I'm not sure to understand what you want, can you give an example of the assertions you would like to be generated ?

I'm gonna try to answer anyway, as CartAssert.assertThat(List items) parameter is a List, it then provides List assertions, note that it will use Item's equals method to compare Item.

Generated assertions are limited (it can't guess what you really want !) so what I would do is to add the generated CartAssert to your source control and change it to suit your needs.

@joel-costigliola
Copy link
Member

Reopen it if you think it should be.

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