From 00eb114a509d812ed8af52526f7e4d74956d9ec4 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Fri, 15 Dec 2023 15:27:14 +0100 Subject: [PATCH 01/12] bump parent 6.11.5 -> 6.11.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 72670c6..9d8d15b 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.5-SNAPSHOT + 6.11.7-SNAPSHOT hapi-fhir-jpaserver-starter From c8a71c2e6499779e818375bea01e08f623f51cb9 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Fri, 15 Dec 2023 15:53:07 +0100 Subject: [PATCH 02/12] removed version of junit dependencies to use the managed version --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9d8d15b..d02c883 100644 --- a/pom.xml +++ b/pom.xml @@ -429,13 +429,11 @@ org.junit.jupiter junit-jupiter-api - 5.7.2 test org.junit.jupiter junit-jupiter-engine - 5.7.2 test From eafa7cfb4cff9d385f0c3cbb97a909d34f1fd924 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Mon, 18 Dec 2023 09:07:59 +0100 Subject: [PATCH 03/12] servletWebServerFactory made lazy to run as web application --- src/main/java/ca/uhn/fhir/jpa/starter/Application.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java index c626c96..36a432c 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java @@ -28,6 +28,7 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.Lazy; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; @@ -72,6 +73,7 @@ public class Application extends SpringBootServletInitializer { } @Bean + @Lazy public ServletWebServerFactory servletWebServerFactory() { return new JettyServletWebServerFactory(); } From e49a9219aff03f748422e10ad8aa17b0e4b3bf4c Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Thu, 21 Dec 2023 11:54:23 +0100 Subject: [PATCH 04/12] servletWebServerFactory definitely breaks things (spring-boot not starting with tomcat, and running as web application doesn't work if the bean is not at least lazy) I'm removing it, it shouldn't be necessary (to run spring-spring boot with jetty, it's enough to enable the jetty profile?) --- src/main/java/ca/uhn/fhir/jpa/starter/Application.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java index 36a432c..4714aa8 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java @@ -72,10 +72,4 @@ public class Application extends SpringBootServletInitializer { return servletRegistrationBean; } - @Bean - @Lazy - public ServletWebServerFactory servletWebServerFactory() { - return new JettyServletWebServerFactory(); - } - } From a2a7e7681a126b651cc00140c2fe8ffbbe72e69b Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Thu, 21 Dec 2023 16:32:12 +0100 Subject: [PATCH 05/12] fix test/compile/runtime dependencies of jetty to get spring-boot runnability with jetty and tomcat, tests, and deployment as web application --- pom.xml | 83 ++++----------------------------------------------------- 1 file changed, 5 insertions(+), 78 deletions(-) diff --git a/pom.xml b/pom.xml index 71daa34..f48e766 100644 --- a/pom.xml +++ b/pom.xml @@ -250,68 +250,6 @@ test - - org.eclipse.jetty - jetty-http - test - - - org.eclipse.jetty - jetty-io - test - - - org.eclipse.jetty - jetty-security - test - - - org.eclipse.jetty - jetty-xml - test - - - org.eclipse.jetty.ee10 - jetty-ee10-servlet - test - - - org.eclipse.jetty.ee10 - jetty-ee10-servlets - test - - - org.eclipse.jetty.ee10.websocket - jetty-ee10-websocket-jakarta-client - test - - - org.eclipse.jetty.ee10.websocket - jetty-ee10-websocket-jakarta-server - test - - - org.eclipse.jetty.ee10.websocket - jetty-ee10-websocket-jetty-server - ${jetty_version} - test - - - org.eclipse.jetty.websocket - jetty-websocket-jetty-server - test - - - org.eclipse.jetty - jetty-server - test - - - org.eclipse.jetty - jetty-util - test - - ca.uhn.hapi.fhir hapi-fhir-jpaserver-test-utilities @@ -356,16 +294,6 @@ hapi-fhir-test-utilities ${project.version} test - - - org.eclipse.jetty.ee10 - * - - - org.eclipse.jetty - * - - @@ -632,12 +560,6 @@ org.springframework.boot spring-boot-starter-web ${spring_boot_version} - - - org.springframework.boot - spring-boot-starter-tomcat - - @@ -658,6 +580,11 @@ + + org.springframework.boot + spring-boot-starter-jetty + ${spring_boot_version} + From 36598c2e7e818d159a59dd52356d125bdcadcabc Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Thu, 21 Dec 2023 16:52:16 +0100 Subject: [PATCH 06/12] created a separated tomcat profile to run spring-boot with default server --- pom.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pom.xml b/pom.xml index f48e766..06d1a9c 100644 --- a/pom.xml +++ b/pom.xml @@ -560,6 +560,12 @@ org.springframework.boot spring-boot-starter-web ${spring_boot_version} + + + org.springframework.boot + spring-boot-starter-tomcat + + @@ -586,6 +592,15 @@ ${spring_boot_version} + + tomcat + + + org.springframework.boot + spring-boot-starter-web + ${spring_boot_version} + + ossrh-repo From 142191b2bdc4ee0623ad956cd6b537516d16e965 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Thu, 21 Dec 2023 16:58:28 +0100 Subject: [PATCH 07/12] unused imports in Application.java --- src/main/java/ca/uhn/fhir/jpa/starter/Application.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java index 4714aa8..bec7871 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java @@ -4,7 +4,6 @@ import ca.uhn.fhir.batch2.jobs.config.Batch2JobsConfig; import ca.uhn.fhir.jpa.batch2.JpaBatch2Config; import ca.uhn.fhir.jpa.starter.annotations.OnEitherVersion; import ca.uhn.fhir.jpa.starter.cdshooks.StarterCdsHooksConfig; -import ca.uhn.fhir.jpa.starter.common.FhirTesterConfig; import ca.uhn.fhir.jpa.starter.cr.StarterCrDstu3Config; import ca.uhn.fhir.jpa.starter.cr.StarterCrR4Config; import ca.uhn.fhir.jpa.starter.mdm.MdmConfig; @@ -19,18 +18,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration; import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Lazy; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; -import org.springframework.web.servlet.DispatcherServlet; @ServletComponentScan(basePackageClasses = {RestfulServer.class}) @SpringBootApplication(exclude = {ElasticsearchRestClientAutoConfiguration.class, ThymeleafAutoConfiguration.class}) From bf683478bce0c9120f148118a6162d2d1e9b610e Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Fri, 22 Dec 2023 11:49:14 +0100 Subject: [PATCH 08/12] fix for tests not working added required jetty dependencies through spring-boot-starter-jetty so this is the only dependency with scope=testing and transitive dependencies (core jetty libraries) aren't marked as such mvn -P jetty spring-boot:run seems to work --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index 06d1a9c..c452a72 100644 --- a/pom.xml +++ b/pom.xml @@ -354,6 +354,13 @@ test + + org.springframework.boot + spring-boot-starter-jetty + ${spring_boot_version} + test + + From f24968a47df5d0f2f46d024819ccacf80a5e82e9 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Fri, 22 Dec 2023 15:32:20 +0100 Subject: [PATCH 09/12] Update smoke-tests.yml jetty-maven-plugin is obsolete, and jetty-ee10-maven-plugin doesn't work at the moment. Using spring-boot to run local server. --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 31568a3..6e76e82 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -33,7 +33,7 @@ jobs: run: docker pull jetbrains/intellij-http-client - name: Start server with jetty run: | - mvn jetty:run & export JPA_PROCESS=$! + mvn -P jetty spring-boot:run & export JPA_PROCESS=$! sleep 80 - name: Execute smoke tests run: docker run --rm -v $PWD:/workdir --add-host host.docker.internal:host-gateway jetbrains/intellij-http-client -D src/test/smoketest/plain_server.http --env-file src/test/smoketest/http-client.env.json --env default From e7b1b892713290558e8cffbd643caf554e905b50 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Wed, 3 Jan 2024 08:45:48 +0100 Subject: [PATCH 10/12] reverting profiles to the current situation in the master branch: spring-boot:run by defaults starts tomcat, while the jetty profile enables jetty added a fix to run the generated war with spring-boot on tomcat, due to issues with spring-boot 3.2.0 https://github.com/spring-projects/spring-boot/issues/38585 the jar generated with jetty doesn't work at the moment --- pom.xml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index c452a72..facd1d6 100644 --- a/pom.xml +++ b/pom.xml @@ -387,6 +387,14 @@ org.springframework.boot spring-boot-maven-plugin + + + CLASSIC + @@ -567,12 +575,6 @@ org.springframework.boot spring-boot-starter-web ${spring_boot_version} - - - org.springframework.boot - spring-boot-starter-tomcat - - @@ -599,15 +601,6 @@ ${spring_boot_version} - - tomcat - - - org.springframework.boot - spring-boot-starter-web - ${spring_boot_version} - - ossrh-repo From 0a95e71cbc26b46f38a4df56e7f1e342fc690ac7 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Wed, 3 Jan 2024 15:12:38 +0100 Subject: [PATCH 11/12] fixed integration test execution; tests are now done with tomcat, unless "jetty" profile is active (in which case they're done with jetty) Test class JpaStarterWebsocketDispatcherConfig emptied, not sure if necessary (it's now missing jetty dependencies) --- pom.xml | 26 +++++++---- .../JpaStarterWebsocketDispatcherConfig.java | 44 +++++++++---------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index facd1d6..21e428b 100644 --- a/pom.xml +++ b/pom.xml @@ -294,6 +294,24 @@ hapi-fhir-test-utilities ${project.version} test + + + org.eclipse.jetty.ee10 + * + + + org.eclipse.jetty.ee10.websocket + * + + + org.eclipse.jetty + * + + + org.eclipse.jetty.websocket + * + + @@ -350,14 +368,6 @@ org.springframework.boot spring-boot-starter-test - ${spring_boot_version} - test - - - - org.springframework.boot - spring-boot-starter-jetty - ${spring_boot_version} test diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java b/src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java index 34c8949..639fda5 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java @@ -1,10 +1,10 @@ package ca.uhn.fhir.jpa.starter; -import org.eclipse.jetty.ee10.webapp.WebAppContext; -import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; -import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.context.annotation.Bean; +//import org.eclipse.jetty.ee10.webapp.WebAppContext; +//import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; +//import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; +//import org.springframework.boot.web.server.WebServerFactoryCustomizer; +//import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** @@ -14,21 +14,21 @@ import org.springframework.context.annotation.Configuration; @Configuration public class JpaStarterWebsocketDispatcherConfig { - @Bean - public Jetty12WebSocketServletWebServerCustomizer jetty10WebSocketServletWebServerCustomizer() { - return new Jetty12WebSocketServletWebServerCustomizer(); - } - - static class Jetty12WebSocketServletWebServerCustomizer implements WebServerFactoryCustomizer { - - @Override - public void customize(JettyServletWebServerFactory factory) { - - factory.addServerCustomizers(server -> { - WebAppContext ctx = (WebAppContext) server.getHandler(); - JakartaWebSocketServletContainerInitializer.configure(ctx, null); - }); - - } - } +// @Bean +// public Jetty12WebSocketServletWebServerCustomizer jetty10WebSocketServletWebServerCustomizer() { +// return new Jetty12WebSocketServletWebServerCustomizer(); +// } +// +// static class Jetty12WebSocketServletWebServerCustomizer implements WebServerFactoryCustomizer { +// +// @Override +// public void customize(JettyServletWebServerFactory factory) { +// +// factory.addServerCustomizers(server -> { +// WebAppContext ctx = (WebAppContext) server.getHandler(); +// JakartaWebSocketServletContainerInitializer.configure(ctx, null); +// }); +// +// } +// } } From d762c18765ab13deff274ffdaeb3c40297af4f79 Mon Sep 17 00:00:00 2001 From: Matteo Steccolini Date: Thu, 25 Jan 2024 08:53:29 +0100 Subject: [PATCH 12/12] requested changes: upgrade to hapi-fhir-7.0.0-SNAPSHOT, removed empty JpaStarterWebsocketDispatcherConfig and references unrequested changes: commons-logging dependency marked provided (to avoid redundant jar inclusion), removed unused imports in classes that were modified --- pom.xml | 10 +++++- .../uhn/fhir/jpa/starter/CustomBeanTest.java | 2 +- .../jpa/starter/CustomInterceptorTest.java | 2 +- .../jpa/starter/ElasticsearchLastNR4IT.java | 2 +- .../jpa/starter/ExampleServerDstu2IT.java | 2 +- .../jpa/starter/ExampleServerDstu3IT.java | 4 --- .../fhir/jpa/starter/ExampleServerR4BIT.java | 2 +- .../fhir/jpa/starter/ExampleServerR4IT.java | 2 -- .../JpaStarterWebsocketDispatcherConfig.java | 34 ------------------- .../jpa/starter/MultitenantServerR4IT.java | 2 +- 10 files changed, 15 insertions(+), 47 deletions(-) delete mode 100644 src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java diff --git a/pom.xml b/pom.xml index 21e428b..d79dd8d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ ca.uhn.hapi.fhir hapi-fhir - 6.11.7-SNAPSHOT + 7.0.0-SNAPSHOT hapi-fhir-jpaserver-starter @@ -194,6 +194,14 @@ spring-web + + + commons-logging + commons-logging + 1.2 + provided + + org.apache.commons diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/CustomBeanTest.java b/src/test/java/ca/uhn/fhir/jpa/starter/CustomBeanTest.java index d5a3d18..3a7dee5 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/CustomBeanTest.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/CustomBeanTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, properties = { +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class}, properties = { "hapi.fhir.custom-bean-packages=some.custom.pkg1,some.custom.pkg2", "spring.datasource.url=jdbc:h2:mem:dbr4", "hapi.fhir.enable_repository_validating_interceptor=true", diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/CustomInterceptorTest.java b/src/test/java/ca/uhn/fhir/jpa/starter/CustomInterceptorTest.java index 859752a..daf6438 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/CustomInterceptorTest.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/CustomInterceptorTest.java @@ -13,7 +13,7 @@ import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum; -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, properties = { +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class}, properties = { "hapi.fhir.custom-bean-packages=some.custom.pkg1", "hapi.fhir.custom-interceptor-classes=some.custom.pkg1.CustomInterceptorBean,some.custom.pkg1.CustomInterceptorPojo", "spring.datasource.url=jdbc:h2:mem:dbr4", diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java index c12f531..9d4c033 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java @@ -44,7 +44,7 @@ import org.testcontainers.junit.jupiter.Testcontainers; @ExtendWith(SpringExtension.class) @Testcontainers -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, properties = +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class}, properties = { "spring.datasource.url=jdbc:h2:mem:dbr4", "hapi.fhir.fhir_version=r4", diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java index e65d52f..e8fd9ad 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu2IT.java @@ -16,7 +16,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.junit.jupiter.api.Assertions.assertEquals; @ExtendWith(SpringExtension.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, properties = +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class}, properties = { "hapi.fhir.fhir_version=dstu2", "spring.datasource.url=jdbc:h2:mem:dbr2", diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java index 19b453f..2aadf2e 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java @@ -17,7 +17,6 @@ import org.apache.commons.io.FileUtils; import org.hl7.fhir.dstu3.model.*; import org.hl7.fhir.instance.model.api.IIdType; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -31,8 +30,6 @@ import java.io.IOException; import java.net.URI; import java.util.Collection; import java.util.List; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; import static ca.uhn.fhir.util.TestUtil.waitForSize; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -43,7 +40,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = { Application.class, - JpaStarterWebsocketDispatcherConfig.class, RepositoryConfig.class }, properties = { diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4BIT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4BIT.java index be49949..46acecd 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4BIT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4BIT.java @@ -15,7 +15,7 @@ import org.springframework.boot.test.web.server.LocalServerPort; import static org.junit.jupiter.api.Assertions.assertEquals; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, + classes = {Application.class}, properties = { "spring.datasource.url=jdbc:h2:mem:dbr4b", "hapi.fhir.enable_repository_validating_interceptor=true", diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java index 9eebaa0..9c0f85d 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java @@ -27,7 +27,6 @@ import org.hl7.fhir.r4.model.Period; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Subscription; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -53,7 +52,6 @@ import static org.opencds.cqf.fhir.utility.r4.Parameters.stringPart; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = { Application.class, - JpaStarterWebsocketDispatcherConfig.class, NicknameServiceConfig.class, RepositoryConfig.class }, properties = { diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java b/src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java deleted file mode 100644 index 639fda5..0000000 --- a/src/test/java/ca/uhn/fhir/jpa/starter/JpaStarterWebsocketDispatcherConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -package ca.uhn.fhir.jpa.starter; - -//import org.eclipse.jetty.ee10.webapp.WebAppContext; -//import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; -//import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; -//import org.springframework.boot.web.server.WebServerFactoryCustomizer; -//import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * This class ensures that websockets work with - * Spring + Spring Boot + Jetty - */ -@Configuration -public class JpaStarterWebsocketDispatcherConfig { - -// @Bean -// public Jetty12WebSocketServletWebServerCustomizer jetty10WebSocketServletWebServerCustomizer() { -// return new Jetty12WebSocketServletWebServerCustomizer(); -// } -// -// static class Jetty12WebSocketServletWebServerCustomizer implements WebServerFactoryCustomizer { -// -// @Override -// public void customize(JettyServletWebServerFactory factory) { -// -// factory.addServerCustomizers(server -> { -// WebAppContext ctx = (WebAppContext) server.getHandler(); -// JakartaWebSocketServletContainerInitializer.configure(ctx, null); -// }); -// -// } -// } -} diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/MultitenantServerR4IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/MultitenantServerR4IT.java index 3c50fb6..bbe1348 100644 --- a/src/test/java/ca/uhn/fhir/jpa/starter/MultitenantServerR4IT.java +++ b/src/test/java/ca/uhn/fhir/jpa/starter/MultitenantServerR4IT.java @@ -18,7 +18,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import static org.junit.jupiter.api.Assertions.assertEquals; @ExtendWith(SpringExtension.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, properties = +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class}, properties = { "spring.datasource.url=jdbc:h2:mem:dbr4-mt", "hapi.fhir.fhir_version=r4",