|
|
|
|
@ -16,7 +16,11 @@
@@ -16,7 +16,11 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.security.config.annotation.rsocket; |
|
|
|
|
|
|
|
|
|
import io.rsocket.RSocketFactory; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
import io.rsocket.core.RSocketServer; |
|
|
|
|
import io.rsocket.exceptions.ApplicationErrorException; |
|
|
|
|
import io.rsocket.frame.decoder.PayloadDecoder; |
|
|
|
|
import io.rsocket.transport.netty.server.CloseableChannel; |
|
|
|
|
@ -25,6 +29,9 @@ import org.junit.After;
@@ -25,6 +29,9 @@ import org.junit.After;
|
|
|
|
|
import org.junit.Before; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
import org.junit.runner.RunWith; |
|
|
|
|
import reactor.core.publisher.Flux; |
|
|
|
|
import reactor.core.publisher.Mono; |
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
|
@ -43,12 +50,6 @@ import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata;
@@ -43,12 +50,6 @@ import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata;
|
|
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
|
import org.springframework.test.context.ContextConfiguration; |
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner; |
|
|
|
|
import reactor.core.publisher.Flux; |
|
|
|
|
import reactor.core.publisher.Mono; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
import static org.assertj.core.api.Assertions.assertThatCode; |
|
|
|
|
@ -74,12 +75,13 @@ public class RSocketMessageHandlerITests {
@@ -74,12 +75,13 @@ public class RSocketMessageHandlerITests {
|
|
|
|
|
|
|
|
|
|
@Before |
|
|
|
|
public void setup() { |
|
|
|
|
this.server = RSocketFactory.receive() |
|
|
|
|
.frameDecoder(PayloadDecoder.ZERO_COPY) |
|
|
|
|
.addSocketAcceptorPlugin(this.interceptor) |
|
|
|
|
this.server = RSocketServer.create() |
|
|
|
|
.payloadDecoder(PayloadDecoder.ZERO_COPY) |
|
|
|
|
.interceptors((registry) -> { |
|
|
|
|
registry.forSocketAcceptor(this.interceptor); |
|
|
|
|
}) |
|
|
|
|
.acceptor(this.handler.responder()) |
|
|
|
|
.transport(TcpServerTransport.create("localhost", 0)) |
|
|
|
|
.start() |
|
|
|
|
.bind(TcpServerTransport.create("localhost", 0)) |
|
|
|
|
.block(); |
|
|
|
|
|
|
|
|
|
this.requester = RSocketRequester.builder() |
|
|
|
|
|