use of io.rsocket.exceptions.RejectedSetupException in project spring-security by spring-projects.
the class RSocketMessageHandlerConnectionITests method connectWhenNotAuthorized.
@Test
public void connectWhenNotAuthorized() {
UsernamePasswordMetadata credentials = new UsernamePasswordMetadata("evil", "password");
// @formatter:off
this.requester = requester().setupMetadata(credentials, UsernamePasswordMetadata.BASIC_AUTHENTICATION_MIME_TYPE).connectTcp(this.server.address().getHostName(), this.server.address().getPort()).block();
assertThatExceptionOfType(Exception.class).isThrownBy(() -> this.requester.route("retrieve-mono").data("data").retrieveMono(String.class).block()).matches((ex) -> ex instanceof RejectedSetupException || ex.getClass().toString().contains("ReactiveException"));
// @formatter:on
// FIXME: https://github.com/rsocket/rsocket-java/issues/686
}
Aggregations