You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/09/19 21:59:42 UTC
(maven-javadoc-plugin) branch agent/drop-hamcrest created (now e68aac88)
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a change to branch agent/drop-hamcrest
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
at e68aac88 Drop Hamcrest from tests
This branch includes the following new commits:
new e68aac88 Drop Hamcrest from tests
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(maven-javadoc-plugin) 01/01: Drop Hamcrest from tests
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch agent/drop-hamcrest
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
commit e68aac88821d14765779dd27064963935e722f8a
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat Sep 19 23:59:33 2026 +0200
Drop Hamcrest from tests
---
pom.xml | 7 -------
.../maven/plugins/javadoc/JavadocReportTest.java | 21 +++++++++------------
2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/pom.xml b/pom.xml
index 543f4e3f..d7d4db0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -318,13 +318,6 @@ under the License.
<version>2.22.0</version>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest</artifactId>
- <version>3.0</version>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
index c7521f50..8050d3ea 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
@@ -50,7 +50,6 @@ import org.apache.maven.plugin.logging.Log;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
import org.codehaus.plexus.languages.java.version.JavaVersion;
-import org.hamcrest.MatcherAssert;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -69,8 +68,6 @@ import static org.apache.maven.api.plugin.testing.MojoExtension.setVariableValue
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;
import static org.assertj.core.api.Fail.fail;
-import static org.hamcrest.CoreMatchers.anyOf;
-import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -197,12 +194,11 @@ class JavadocReportTest {
assumeThat(connection.getURL().toString()).isEqualTo(url);
// https://bugs.openjdk.java.net/browse/JDK-8216497
- MatcherAssert.assertThat(
- url + " available, but " + appHtml + " is missing link to java.lang.Object",
- new String(Files.readAllBytes(generatedFile), StandardCharsets.UTF_8),
- anyOf(
- containsString("/docs/api/java/lang/Object.html"),
- containsString("/docs/api/java.base/java/lang/Object.html")));
+ String content = new String(Files.readAllBytes(generatedFile), StandardCharsets.UTF_8);
+ assertTrue(
+ content.contains("/docs/api/java/lang/Object.html")
+ || content.contains("/docs/api/java.base/java/lang/Object.html"),
+ url + " available, but " + appHtml + " is missing link to java.lang.Object");
} catch (TestAbortedException e) {
LOGGER.warn("ignoring defaultAPI check: {}", e.getMessage());
}
@@ -212,9 +208,10 @@ class JavadocReportTest {
throw e;
}
} else {
- MatcherAssert.assertThat(
- new String(Files.readAllBytes(generatedFile), StandardCharsets.UTF_8),
- containsString("/docs/api/java.base/java/lang/Object.html"));
+ String content = new String(Files.readAllBytes(generatedFile), StandardCharsets.UTF_8);
+ assertTrue(
+ content.contains("/docs/api/java.base/java/lang/Object.html"),
+ appHtml + " is missing link to java.lang.Object");
}
assertThat(apidocs.resolve("def/configuration/AppSample.html")).exists();