JavaHamcrest icon indicating copy to clipboard operation
JavaHamcrest copied to clipboard

Java (and original) version of Hamcrest

Results 146 JavaHamcrest issues
Sort by recently updated
recently updated
newest added

While working on #294 I noticed there's a bit of a mess from a code style point of view. See e.g. IsCollectionWithSize: there's a mix of tabs with 2 spaces...

The following JUnit can reproduce: @Test public void enumTest() { Set dayOfWeekSet = new HashSet(); dayOfWeekSet.add(DayOfWeek.MONDAY); // I expect this to fail. assertThat(dayOfWeekSet, containsInAnyOrder(DayOfWeek.values())); } I'm using: org.hamcrest hamcrest-all 1.3...

The algorithm goes like: for each item, try each matcher in the given order and consume the first one that matches. This causes the following test to fail: ``` @Test...

Why `IsMapContaining.hasKey(K key)` is iterating over whole map, instead of calling `Map.containsKey`? Latter is much faster!

When using hamcrest via remote junit runners there may be issues because AssumptionViolatedException stores fields that may not be serializable. If the the message was created in the constructor rather...

I wrote the following, that I haven't seen anywhere else. I think it would be a good addition to Hamcrest. Usage is something like `matcher("nonempty string", s -> s.length() >...

Hi! Let's say I have a custom `isOpened()` matcher that checks if a page has been opened. It has the following methods: ```java @Override public void describeTo(Description description) { description.appendText("Page...

If an instance of a default scoped class is passed into the hasProperty matcher, the assertion will always fail when the get method is invoked to get the value of...

Here is some example code showing what I think is a bug ``` import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.not; import java.util.HashMap; import java.util.List; import...

enhancement

The EventuallyMatcher is a matcher that will evaluate another matcher repeatedly until it matches, or fail after some number of attempts. This is useful when waiting for results from a...

enhancement