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)
This commit is contained in:
Matteo Steccolini
2024-01-03 15:12:38 +01:00
parent e7b1b89271
commit 0a95e71cbc
2 changed files with 40 additions and 30 deletions

26
pom.xml
View File

@@ -294,6 +294,24 @@
<artifactId>hapi-fhir-test-utilities</artifactId> <artifactId>hapi-fhir-test-utilities</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<scope>test</scope> <scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty.ee10.websocket</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
@@ -350,14 +368,6 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>${spring_boot_version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<version>${spring_boot_version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

View File

@@ -1,10 +1,10 @@
package ca.uhn.fhir.jpa.starter; package ca.uhn.fhir.jpa.starter;
import org.eclipse.jetty.ee10.webapp.WebAppContext; //import org.eclipse.jetty.ee10.webapp.WebAppContext;
import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; //import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; //import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer; //import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/** /**
@@ -14,21 +14,21 @@ import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
public class JpaStarterWebsocketDispatcherConfig { public class JpaStarterWebsocketDispatcherConfig {
@Bean // @Bean
public Jetty12WebSocketServletWebServerCustomizer jetty10WebSocketServletWebServerCustomizer() { // public Jetty12WebSocketServletWebServerCustomizer jetty10WebSocketServletWebServerCustomizer() {
return new Jetty12WebSocketServletWebServerCustomizer(); // return new Jetty12WebSocketServletWebServerCustomizer();
} // }
//
static class Jetty12WebSocketServletWebServerCustomizer implements WebServerFactoryCustomizer<JettyServletWebServerFactory> { // static class Jetty12WebSocketServletWebServerCustomizer implements WebServerFactoryCustomizer<JettyServletWebServerFactory> {
//
@Override // @Override
public void customize(JettyServletWebServerFactory factory) { // public void customize(JettyServletWebServerFactory factory) {
//
factory.addServerCustomizers(server -> { // factory.addServerCustomizers(server -> {
WebAppContext ctx = (WebAppContext) server.getHandler(); // WebAppContext ctx = (WebAppContext) server.getHandler();
JakartaWebSocketServletContainerInitializer.configure(ctx, null); // JakartaWebSocketServletContainerInitializer.configure(ctx, null);
}); // });
//
} // }
} // }
} }