How do I assert to accept one of multiple possible values in JUnit
I have a test that returns some value after completion. The returned value is a String and can have one of several possible values based on some if condition in the test. But in the assert statement I can check only one of the Expected values not both.
How can I do this? Thank you.
Using a boolean expression with OR would not work?
I will use AssertJ for this
assertThat(value).isIn(expected1, expected2, expected3);
The code is much simpler than with Hamcrest.