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

Add ResultAssert #9

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

sviperll
Copy link
Owner

Replace #8 to merge into non-main branch

@sviperll sviperll mentioned this pull request Nov 26, 2024
@marcindabrowski
Copy link
Contributor

Hey @sviperll, any progress on this?
Do you want me to work on this?

@sviperll
Copy link
Owner Author

I'm actually quite busy lately. I'd like to work on this tomorrow. One thing that you may want to work on is to

  1. Add documentation (javadoc) to ResultAssert class, it's good to add a couple of examples there and probably add some documentation to some methods.

  2. I'm not sure if ResultAssert#hasErrorThat(Consumer) is an idiomatic assertj-API. Are there similar methods that accept Consumer as an argument? I haven't seen such methods, I would prefer to avoid it completely or to research some alternatives. From my own quick research, I'm thinking that maybe better alternative is to return AbstractAssert (For Object-type, but this is ok, since we can do asInstanceOf to specialize). Your example would become:

         ResultAssert.assertThat(result)
                    .isError()
                    .hasErrorThat()
                    .isInstanceOf(NumberFormatException.class);
    

@sviperll sviperll merged commit ea827bd into sviperll:feature/assertj Nov 28, 2024
0 of 2 checks passed
@marcindabrowski marcindabrowski deleted the feature/assertj branch December 6, 2024 09:19
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

Successfully merging this pull request may close these issues.

2 participants