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

When a matcher extending TypeSafeDiagnosingMatcher fails the method matchesSafely is executed twice. This is bad especially when the evaluation in matchesSafely is expensive. The second problem is that the item...

# Security Vulnerability Fix This pull request fixes either 1.) Temporary Directory Hijacking Vulnerability, or 2.) Temporary Directory Information Disclosure Vulnerability, which existed in this project. ## Preamble The system...

Environment: **Java 11**, **hamcrest 2.2** Due to strange signature of **everyItem()**: ` public static org.hamcrest.Matcher

This is a fix for issue #248 I'm not sure about the names I used, but could not find better ones. Don't hesitate to propose some. This introduces some loss...

enhancement

Add related matchers library [g4s8/matchers-json](https://github.com/g4s8/matchers-json) with Hamcrest objects for `javax.json` `JsonObject`, `JsonArray` and `JsonValue`; also, support raw string JSON arrays/objects via adapters.

Given an actual map like this: ```java Map actual = Map.of( "k1", Map.of( "k11", "v11", "k12", "v12"), "k2", List.of("v21", "v22"), "k3", "V3" ); ``` I wish/expect to make an assertion...

I found for myself that the matcher name "contains" is a bit misleading. Because it sounds similarly to `contains()` method of `java.util.Collection` it may expected to behave like this: `assertThat(List.of(1,2),...

The return type of the hasEntry matcher is invariant on its type parameters which prevents javac/jdt from inferring compatible types. This prevents writing ``` public void testFoo() { Map m...

* Add `FloatIsCloseTo` matcher as copy of `IsCloseTo` matcher * Rename `IsCloseTo` matcher to `DoubleIsCloseTo` * Change error message for excluding errors in additional floating calculations (May user catch this...

enhancement

Updated pull request #226. Changes: * Create base class `BaseCloseTo` for all closeTo matchers * Add `FloatCloseTo` matcher * Rename `IsCloseTo` matcher to `DoubleCloseTo` * Change error message for excluding...