-
Notifications
You must be signed in to change notification settings - Fork 163
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
Remove some more MatcherAssert #1393
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,9 @@ | |
import java.io.IOException; | ||
import java.util.IllegalFormatException; | ||
import org.cactoos.iterable.IterableOf; | ||
import org.hamcrest.MatcherAssert; | ||
import org.hamcrest.core.IsEqual; | ||
import org.junit.Test; | ||
import org.llorllale.cactoos.matchers.Assertion; | ||
|
||
/** | ||
* Test case for {@link FallbackFrom}. | ||
|
@@ -41,37 +41,37 @@ public final class FallbackFromTest { | |
|
||
@Test | ||
public void supportsException() { | ||
MatcherAssert.assertThat( | ||
"IOException class is not supported, but should be", | ||
new Assertion<>( | ||
"Must support exactly exception class", | ||
new FallbackFrom<>( | ||
new IterableOf<>(IOException.class), | ||
exp -> "IOException fallback" | ||
).support(IOException.class), | ||
new IsEqual<>(0) | ||
); | ||
).affirm(); | ||
} | ||
|
||
@Test | ||
public void supportsInheritedException() { | ||
MatcherAssert.assertThat( | ||
"RuntimeException class is not supported, but should be", | ||
new Assertion<>( | ||
"Must support inherited exception class", | ||
new FallbackFrom<>( | ||
new IterableOf<>(RuntimeException.class), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @victornoel error log: |
||
exp -> "RuntimeException fallback #1" | ||
).support(IllegalFormatException.class), | ||
new IsEqual<>(2) | ||
); | ||
).affirm(); | ||
} | ||
|
||
@Test | ||
public void doesNotSupportException() { | ||
MatcherAssert.assertThat( | ||
"RuntimeException class is supported, but should not be", | ||
new Assertion<>( | ||
"Must not support unrelated exception class", | ||
new FallbackFrom<>( | ||
new IterableOf<>(RuntimeException.class), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @victornoel error log: |
||
exp -> "RuntimeException fallback #2" | ||
).support(ClassNotFoundException.class), | ||
new IsEqual<>(Integer.MIN_VALUE) | ||
); | ||
).affirm(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victornoel error log:
unchecked generic array creation for varargs parameter of type java.lang.Class<? extends java.lang.Throwable>[]