use of org.springframework.security.rsocket.metadata.SimpleAuthenticationEncoder in project spring-boot by spring-projects.
the class SampleRSocketApplicationTests method rSocketEndpoint.
@Test
void rSocketEndpoint() {
RSocketRequester requester = this.builder.rsocketStrategies((builder) -> builder.encoder(new SimpleAuthenticationEncoder())).setupMetadata(new UsernamePasswordMetadata("user", "password"), MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString())).tcp("localhost", this.port);
Mono<Project> result = requester.route("find.project.spring-boot").retrieveMono(Project.class);
StepVerifier.create(result).assertNext((project) -> Assertions.assertThat(project.getName()).isEqualTo("spring-boot")).verifyComplete();
}
Aggregations