slachiewicz commented on PR #179:
URL: 
https://github.com/apache/maven-resolver-ant-tasks/pull/179#issuecomment-5233932053

   Added a second commit removing Hamcrest, so the suite now depends on nothing 
but JUnit 5. Kept separate from the migration commit so it can be dropped 
independently if you would rather not take it.
   
   Most of the ~50 call sites map straight across: `notNullValue`/`nullValue` 
to `assertNotNull`/`assertNull`, `equalTo` and `is` to `assertEquals`, 
`instanceOf` to `assertInstanceOf` — which also returns the narrowed reference, 
so the cast that followed it goes away.
   
   The four matchers with no counterpart — `everyItem`, `hasItemInArray`, 
`containsInAnyOrder`, and `allOf(greaterThanOrEqualTo, lessThanOrEqualTo)` — 
become stream or boolean expressions. That does lose the matcher's 
self-describing mismatch text, so each replacement names the offending value in 
its message. In practice the output is at least as good: the `everyItem` case 
now prints the whole directory listing, where Hamcrest printed only the first 
mismatching item.
   
   Because "the tests still pass" is weak evidence for an assertion rewrite, I 
checked one negatively — mutating the `everyItem` replacement to expect the 
wrong suffix produces:
   
   ```
   org.opentest4j.AssertionFailedError: found non-javadoc files:
     [org.eclipse.aether-aether-api-javadoc.jar, 
org.eclipse.aether-aether-spi-javadoc.jar,
      org.eclipse.aether-aether-util-javadoc.jar, 
org.eclipse.aether-aether-impl-javadoc.jar]
     ==> expected: <true> but was: <false>
   ```
   
   so the rewritten assertions are not vacuously true.
   
   `org.hamcrest:hamcrest` and the `hamcrestVersion` property are gone from the 
POM.
   
   Re-verified on the full branch: `mvn test` → `Tests run: 58, Failures: 0, 
Errors: 0, Skipped: 0`; `mvn -Prun-its verify` → exit 0 with `<junitlauncher>` 
reporting 17 classes and the same 58 tests; `spotless:check` clean.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to