Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Wed, 04 Jun 2025 12:57:49 +0000 Subject: [pgjdbc/pgjdbc] PR #3654: chore: make the build fail in case the tests are not declared properly List-Id: X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Issue: 3654 X-GitHub-Labels: chore X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: closed X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3654 Content-Type: text/plain; charset=utf-8 JUnit 5.13 can detect misplaced @Test annotations which were previously ignored. For instance, if the method returns Object rather than void, JUnit ignores the test. After the change, such issues should result in a build failure. The new property requires JUnit 5.13, so I'll move the change to https://github.com/pgjdbc/pgjdbc/pull/3652 Here's a sample failure: ``` > Task :postgresql:test FAILED FAILURE 0,0sec, UnknownClass > initializationError org.junit.platform.launcher.core.DiscoveryIssueException: TestEngine with ID 'junit-jupiter' encountered 2 critical issues during test discovery: (1) [WARNING] @Test method 'private int org.postgresql.test.jdbc42.SetObject310InfinityTest.abc()' must not be private. It will not be executed. Source: MethodSource [className = 'org.postgresql.test.jdbc42.SetObject310InfinityTest', methodName = 'abc', methodParameterTypes = ''] at org.postgresql.test.jdbc42.SetObject310InfinityTest.abc(SourceFile:0) (2) [WARNING] @Test method 'private int org.postgresql.test.jdbc42.SetObject310InfinityTest.abc()' must not return a value. It will not be executed. Source: MethodSource [className = 'org.postgresql.test.jdbc42.SetObject310InfinityTest', methodName = 'abc', methodParameterTypes = ''] at org.postgresql.test.jdbc42.SetObject310InfinityTest.abc(SourceFile:0) ```