This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-jxr.git
commit c87068ea569f74ca779cde97efd315622edbc331 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Tue Nov 17 07:06:56 2026 +0000 Use JUnit 5 assertions and Mockito best practices in tests --- .../test/java/org/apache/maven/plugin/jxr/JxrReportUtilTest.java | 8 ++++---- .../test/java/org/apache/maven/jxr/pacman/JavaFileImplTest.java | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportUtilTest.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportUtilTest.java index 6b72306..0d36308 100644 --- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportUtilTest.java +++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportUtilTest.java @@ -40,7 +40,7 @@ class JxrReportUtilTest { * the {@code dav:} one, see {@link #davUrlKeepsItsHost()}. */ @Test - void structureFollowsTheSiteUrl() throws IOException { + void structureFollowsTheSiteUrl() throws Exception { assertStructure( "maven.apache.org/plugins/maven-jxr-plugin/", "https://maven.apache.org/plugins/maven-jxr-plugin/"); assertStructure( @@ -61,7 +61,7 @@ class JxrReportUtilTest { * {@code .apache.org/plugins/x}. The {@code dav:} prefix is now peeled off like the SCM one. */ @Test - void davUrlKeepsItsHost() throws IOException { + void davUrlKeepsItsHost() throws Exception { assertEquals( "maven.apache.org/plugins/x", JxrReportUtil.getStructure(projectWithSiteUrl("dav:https://maven.apache.org/plugins/x"), false)); @@ -75,7 +75,7 @@ class JxrReportUtilTest { } @Test - void missingSiteUrlIsIgnoredWhenAsked() throws IOException { + void missingSiteUrlIsIgnoredWhenAsked() throws Exception { assertNull(JxrReportUtil.getStructure(projectWithSiteUrl(""), true)); } @@ -88,7 +88,7 @@ class JxrReportUtilTest { * Without distributionManagement the structure falls back to the project name hierarchy. */ @Test - void structureFallsBackToTheProjectHierarchy() throws IOException { + void structureFallsBackToTheProjectHierarchy() throws Exception { Model model = new Model(); model.setName("Child"); MavenProject project = new MavenProject(model); diff --git a/maven-jxr/src/test/java/org/apache/maven/jxr/pacman/JavaFileImplTest.java b/maven-jxr/src/test/java/org/apache/maven/jxr/pacman/JavaFileImplTest.java index bcc2823..7cb09cb 100644 --- a/maven-jxr/src/test/java/org/apache/maven/jxr/pacman/JavaFileImplTest.java +++ b/maven-jxr/src/test/java/org/apache/maven/jxr/pacman/JavaFileImplTest.java @@ -18,7 +18,6 @@ */ package org.apache.maven.jxr.pacman; -import java.io.IOException; import java.nio.file.Paths; import java.util.Iterator; @@ -28,7 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; class JavaFileImplTest { @Test - void jxr135LotsOfNested() throws IOException { + void jxr135LotsOfNested() throws Exception { JavaFileImpl javaFile = new JavaFileImpl( Paths.get("src/test/resources/jxr135/org/apache/maven/jxr/pacman/ClassWithNested.java"), "UTF-8"); final Iterator<ClassType> classTypes = javaFile.getClassTypes().iterator(); @@ -52,7 +51,7 @@ class JavaFileImplTest { } @Test - void jxr170MultiLineString() throws IOException { + void jxr170MultiLineString() throws Exception { JavaFileImpl javaFile = new JavaFileImpl( Paths.get("src/test/resources/jxr170/org/apache/maven/jxr/pacman/ClassWithMultiLineString.java"), "UTF-8"); @@ -62,7 +61,7 @@ class JavaFileImplTest { } @Test - void jxr175Java14Record() throws IOException { + void jxr175Java14Record() throws Exception { JavaFileImpl javaFile = new JavaFileImpl( Paths.get("src/test/resources/jxr175/org/apache/maven/jxr/pacman/Java14Record.java"), "UTF-8"); assertEquals(1, javaFile.getClassTypes().size());
