From 8476770ef2af049ccf3d25fdee02394bcd6838bb Mon Sep 17 00:00:00 2001 From: Edgar Espina Date: Thu, 14 May 2026 15:02:38 -0300 Subject: [PATCH 1/2] hibernate: package scanning doesn't work + 7.3.4 - fix #3953 - fix #3956 --- modules/jooby-hibernate/pom.xml | 6 ++++++ modules/jooby-hibernate/src/main/java/module-info.java | 1 + pom.xml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/jooby-hibernate/pom.xml b/modules/jooby-hibernate/pom.xml index 42d3c50b6a..de70a99a84 100644 --- a/modules/jooby-hibernate/pom.xml +++ b/modules/jooby-hibernate/pom.xml @@ -24,6 +24,12 @@ hibernate-core + + org.hibernate.orm + hibernate-scan-jandex + ${hibernate.version} + + org.junit.jupiter diff --git a/modules/jooby-hibernate/src/main/java/module-info.java b/modules/jooby-hibernate/src/main/java/module-info.java index aa7eed4cb3..8b6e620b9d 100644 --- a/modules/jooby-hibernate/src/main/java/module-info.java +++ b/modules/jooby-hibernate/src/main/java/module-info.java @@ -16,4 +16,5 @@ requires jakarta.inject; requires jakarta.persistence; requires java.naming; + requires org.hibernate.orm.scan.jandex; } diff --git a/pom.xml b/pom.xml index d36d86976a..3ef5113e23 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ 7.0.2 1.2 - 7.0.4.Final + 7.3.4.Final 17.6.0 3.53.0 11.20.1 From 7df998e991290c640d20ab926bfe4f2ed5f41cd2 Mon Sep 17 00:00:00 2001 From: Edgar Espina Date: Thu, 14 May 2026 15:57:33 -0300 Subject: [PATCH 2/2] build: fix failing tests on CI --- jooby/src/main/java/io/jooby/Server.java | 11 +++++++++++ jooby/src/test/java/io/jooby/DefaultContextTest.java | 2 +- jooby/src/test/java/io/jooby/Issue2369.java | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/jooby/src/main/java/io/jooby/Server.java b/jooby/src/main/java/io/jooby/Server.java index 5cbd6674f4..706ba148f2 100644 --- a/jooby/src/main/java/io/jooby/Server.java +++ b/jooby/src/main/java/io/jooby/Server.java @@ -93,6 +93,17 @@ abstract class Base implements Server { private final AtomicBoolean stopping = new AtomicBoolean(); + /** + * Clears custom connection lost listeners. Intended for internal testing use to prevent static + * state leakage between tests. Internal usage only. + */ + static void clearState() { + connectionLostListeners.clear(); + connectionLostListeners.add(Base.CONNECTION_LOST); + addressInUseListeners.clear(); + addressInUseListeners.add(Base.ADDRESS_IN_USE); + } + protected void fireStart(List applications, Executor defaultWorker) { for (Jooby app : applications) { app.setDefaultWorker(defaultWorker).start(this); diff --git a/jooby/src/test/java/io/jooby/DefaultContextTest.java b/jooby/src/test/java/io/jooby/DefaultContextTest.java index eb7eeb283d..c1eae28b62 100644 --- a/jooby/src/test/java/io/jooby/DefaultContextTest.java +++ b/jooby/src/test/java/io/jooby/DefaultContextTest.java @@ -865,7 +865,7 @@ void sendErrorCustomHandlerException() { doThrow(new RuntimeException("Handler crashed")).when(errorHandler).apply(any(), any(), any()); ctx.sendError(cause); - verify(log).error(anyString(), anyString(), any(RuntimeException.class)); + verify(log).error(anyString(), any(RuntimeException.class)); } @Test diff --git a/jooby/src/test/java/io/jooby/Issue2369.java b/jooby/src/test/java/io/jooby/Issue2369.java index bd7d5475aa..86e91bfd96 100644 --- a/jooby/src/test/java/io/jooby/Issue2369.java +++ b/jooby/src/test/java/io/jooby/Issue2369.java @@ -8,10 +8,18 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; public class Issue2369 { + @BeforeEach + @AfterEach + public void cleanState() { + Server.Base.clearState(); + } + @Test public void shouldCustomizeServerLostException() { Throwable cause = new IllegalArgumentException();