From 4aeeae5a174e90d1eb469e9d2177b521a12a87a7 Mon Sep 17 00:00:00 2001 From: Jan Opravil Date: Tue, 29 Sep 2026 10:14:42 +0200 Subject: [PATCH] build(test): run the plugins' JUnit 5 unit tests junit-platform-runner pulled JUnit 4 onto the test classpath, so surefire auto-detected the JUnit4 provider and discovered none of the Jupiter tests: every plugin module reported "Tests run: 0" and the build stayed green. Nothing uses the runner, so drop it together with the now unused junit.platform.version property. Hamcrest was only reachable transitively through JUnit 4; its single user, EntryEditorWidgetSorterTest, now asserts with JUnit's assertEquals like the other test classes. Surefire now runs 360 unit tests across 10 plugins (2 skipped). Co-Authored-By: Claude Opus 5.5 --- .../entryeditor/EntryEditorWidgetSorterTest.java | 15 +++++++-------- plugins/pom.xml | 6 ------ pom.xml | 1 - 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/plugins/ldapbrowser.common/src/test/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetSorterTest.java b/plugins/ldapbrowser.common/src/test/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetSorterTest.java index c39e9433c..8ff24acca 100644 --- a/plugins/ldapbrowser.common/src/test/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetSorterTest.java +++ b/plugins/ldapbrowser.common/src/test/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetSorterTest.java @@ -21,8 +21,7 @@ package org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.apache.directory.studio.ldapbrowser.core.model.IAttribute; import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute; @@ -62,7 +61,7 @@ public void setup() public void testEqual() { int result = sorter.compare( null, valueA1, valueA2 ); - assertThat( result, equalTo( 0 ) ); + assertEquals( 0, result ); } @@ -70,7 +69,7 @@ public void testEqual() public void testLeftIsSmaller() { int result = sorter.compare( null, valueA1, valueB ); - assertThat( result, equalTo( -1 ) ); + assertEquals( -1, result ); } @@ -78,7 +77,7 @@ public void testLeftIsSmaller() public void testRightIsSmaller() { int result = sorter.compare( null, valueB, valueA2 ); - assertThat( result, equalTo( 1 ) ); + assertEquals( 1, result ); } @@ -86,7 +85,7 @@ public void testRightIsSmaller() public void testLeftIsEmpty() { int result = sorter.compare( null, empytValue1, valueA2 ); - assertThat( result, equalTo( -1 ) ); + assertEquals( -1, result ); } @@ -94,7 +93,7 @@ public void testLeftIsEmpty() public void testRightIsEmpty() { int result = sorter.compare( null, valueB, empytValue2 ); - assertThat( result, equalTo( 1 ) ); + assertEquals( 1, result ); } @@ -102,7 +101,7 @@ public void testRightIsEmpty() public void testBothAreEmpty() { int result = sorter.compare( null, empytValue1, empytValue2 ); - assertThat( result, equalTo( 0 ) ); + assertEquals( 0, result ); } } diff --git a/plugins/pom.xml b/plugins/pom.xml index 575f92970..1f14638dd 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -161,12 +161,6 @@ ${junit.jupiter.version} test - - org.junit.platform - junit-platform-runner - ${junit.platform.version} - test - org.junit.jupiter junit-jupiter-params diff --git a/pom.xml b/pom.xml index 3aa436252..0e88eefa6 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,6 @@ 2.7.7 2.7.7 - 1.10.2 5.10.2 1.2.17 1.2.17