Skip to content

Commit

Permalink
Upgrade to the latest Spring libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
ralscha committed Feb 29, 2024
1 parent dbd35a2 commit 6b598ec
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 67 deletions.
43 changes: 17 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>wamp2spring-parent</name>

Expand Down Expand Up @@ -45,11 +45,11 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>5.3.26</spring.version>
<spring.boot.version>2.7.5</spring.boot.version>
<spring.version>6.1.4</spring.version>
<spring.boot.version>3.2.3</spring.boot.version>
<jackson.version>2.16.1</jackson.version>
<jackson-dataformat.version>2.16.1</jackson-dataformat.version>
<spring-security.version>5.7.4</spring-security.version>
<spring-security.version>6.2.2</spring-security.version>
<main.basedir>${project.basedir}</main.basedir>
</properties>

Expand All @@ -68,37 +68,37 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.5</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.3</version>
<configuration>
<links>
<link>https://docs.spring.io/spring-framework/docs/5.3.26/javadoc-api/</link>
<link>http://docs.oracle.com/javase/8/docs/api/</link>
<link>https://docs.spring.io/spring-framework/docs/6.1.4/javadoc-api/</link>
<link>https://docs.oracle.com/en/java/javase/17/docs/api/index.html</link>
</links>
<additionalOptions>-Xdoclint:none</additionalOptions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.21.0</version>
<version>3.21.2</version>
<configuration>
<targetJdk>1.8</targetJdk>
<targetJdk>17</targetJdk>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.5</version>
</plugin>
</plugins>

Expand All @@ -111,10 +111,10 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<testSource>1.8</testSource>
<testTarget>1.8</testTarget>
<source>17</source>
<target>17</target>
<testSource>17</testSource>
<testTarget>17</testTarget>
<encoding>UTF-8</encoding>
<parameters>true</parameters>
</configuration>
Expand All @@ -138,7 +138,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.5</version>
</plugin>

<plugin>
Expand Down Expand Up @@ -184,15 +184,6 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<additionalOptions>-Xdoclint:none</additionalOptions>
</configuration>
</plugin>

<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions wamp2spring-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down Expand Up @@ -72,14 +72,14 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>5.10.0</version>
<scope>test</scope>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions wamp2spring-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down Expand Up @@ -41,7 +41,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>5.10.0</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ public static <T> Publisher<Message<T>> toPublisher(MessageChannel messageChanne
if (messageChannel instanceof PollableChannel) {
return adaptPollableChannelToPublisher((PollableChannel) messageChannel);
}
else {
throw new IllegalArgumentException(
"The 'messageChannel' must be an instance of Publisher, "
+ "SubscribableChannel or PollableChannel, not: "
+ messageChannel);
}
throw new IllegalArgumentException(
"The 'messageChannel' must be an instance of Publisher, "
+ "SubscribableChannel or PollableChannel, not: "
+ messageChannel);
}

private static <T> Publisher<Message<T>> adaptSubscribableChannelToPublisher(
Expand Down Expand Up @@ -109,7 +107,7 @@ public void subscribe(Subscriber<? super Message<T>> subscriber) {
&& (m = this.channel.receive()) != null) {
sink.next((Message<T>) m);
}
}), FluxSink.OverflowStrategy.IGNORE).subscribeOn(Schedulers.elastic())
}), FluxSink.OverflowStrategy.IGNORE).subscribeOn(Schedulers.boundedElastic())
.subscribe(subscriber);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.msgpack.jackson.dataformat.MessagePackFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.context.TestPropertySource;
import org.springframework.web.socket.BinaryMessage;
import org.springframework.web.socket.TextMessage;
Expand Down Expand Up @@ -85,7 +85,7 @@ protected WampMessage sendWampMessage(WampMessage msg, DataFormat dataFormat)
WebSocketClient webSocketClient = new StandardWebSocketClient();

try (WebSocketSession webSocketSession = webSocketClient
.doHandshake(result, getHeaders(dataFormat), wampEndpointUrl()).get()) {
.execute(result, getHeaders(dataFormat), wampEndpointUrl()).get()) {

List<WampRole> roles = new ArrayList<>();
roles.add(new WampRole("publisher"));
Expand Down Expand Up @@ -138,7 +138,7 @@ protected WebSocketSession startWebSocketSession(AbstractWebSocketHandler result
DataFormat dataFormat) throws InterruptedException, ExecutionException {
WebSocketClient webSocketClient = new StandardWebSocketClient();
return webSocketClient
.doHandshake(result, getHeaders(dataFormat), wampEndpointUrl()).get();
.execute(result, getHeaders(dataFormat), wampEndpointUrl()).get();
}

protected WebSocketHttpHeaders getHeaders(DataFormat dataFormat) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void connect(URI wampEndpointUrl) throws InterruptedException,

WebSocketClient webSocketClient = new StandardWebSocketClient();
this.webSocketSession = webSocketClient
.doHandshake(this.result, this.headers, wampEndpointUrl).get();
.execute(this.result, this.headers, wampEndpointUrl).get();

sendMessage(helloMessage);
WelcomeMessage welcomeMessage = this.result.getWelcomeMessage();
Expand Down
2 changes: 1 addition & 1 deletion wamp2spring-security-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion wamp2spring-security-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion wamp2spring-security-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down
14 changes: 7 additions & 7 deletions wamp2spring-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down Expand Up @@ -36,10 +36,10 @@
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>

<!-- TEST DEPENDENCIES -->
Expand All @@ -54,7 +54,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>

Expand All @@ -75,7 +75,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>5.10.0</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.msgpack.jackson.dataformat.MessagePackFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.web.socket.BinaryMessage;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketHttpHeaders;
Expand Down Expand Up @@ -83,7 +83,7 @@ protected WampMessage sendWampMessage(WampMessage msg, DataFormat dataFormat)
WebSocketClient webSocketClient = new StandardWebSocketClient();

try (WebSocketSession webSocketSession = webSocketClient
.doHandshake(result, getHeaders(dataFormat), wampEndpointUrl()).get()) {
.execute(result, getHeaders(dataFormat), wampEndpointUrl()).get()) {

List<WampRole> roles = new ArrayList<>();
roles.add(new WampRole("publisher"));
Expand Down Expand Up @@ -136,7 +136,7 @@ protected WebSocketSession startWebSocketSession(AbstractWebSocketHandler result
DataFormat dataFormat) throws InterruptedException, ExecutionException {
WebSocketClient webSocketClient = new StandardWebSocketClient();
return webSocketClient
.doHandshake(result, getHeaders(dataFormat), wampEndpointUrl()).get();
.execute(result, getHeaders(dataFormat), wampEndpointUrl()).get();
}

protected WebSocketHttpHeaders getHeaders(DataFormat dataFormat) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void connect(URI wampEndpointUrl) throws InterruptedException,

WebSocketClient webSocketClient = new StandardWebSocketClient();
this.webSocketSession = webSocketClient
.doHandshake(this.result, this.headers, wampEndpointUrl).get();
.execute(this.result, this.headers, wampEndpointUrl).get();

sendMessage(helloMessage);
WelcomeMessage welcomeMessage = this.result.getWelcomeMessage();
Expand Down
16 changes: 8 additions & 8 deletions wamp2spring-session-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ch.rasc</groupId>
<artifactId>wamp2spring-parent</artifactId>
<version>2.0.9-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-core</artifactId>
<version>2.7.0</version>
<version>3.2.1</version>
</dependency>

<dependency>
Expand All @@ -30,12 +30,12 @@
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>

<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import java.time.Instant;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
Expand All @@ -36,6 +34,7 @@
import ch.rasc.wamp2spring.message.GoodbyeMessage;
import ch.rasc.wamp2spring.message.HelloMessage;
import ch.rasc.wamp2spring.message.WelcomeMessage;
import jakarta.servlet.http.HttpSession;

public final class SessionRepositoryMessageInterceptor<S extends Session>
implements ChannelInterceptor, HandshakeInterceptor {
Expand Down

0 comments on commit 6b598ec

Please sign in to comment.