Merge Add hasAnyRole method in AuthorizePayloadsSpec.Access
This commit is contained in:
@@ -53,6 +53,7 @@ import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
* @author Rob Winch
|
||||
* @author Luis Felipe Vega
|
||||
* @author Jesús Ascama Arias
|
||||
* @author Manuel Tejeda
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringRunner.class)
|
||||
@@ -201,6 +202,23 @@ public class RSocketMessageHandlerConnectionITests {
|
||||
.isInstanceOf(ApplicationErrorException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void connectWithAnyRole() {
|
||||
UsernamePasswordMetadata credentials =
|
||||
new UsernamePasswordMetadata("user", "password");
|
||||
this.requester = requester()
|
||||
.setupMetadata(credentials, UsernamePasswordMetadata.BASIC_AUTHENTICATION_MIME_TYPE)
|
||||
.connectTcp(this.server.address().getHostName(), this.server.address().getPort())
|
||||
.block();
|
||||
|
||||
String hiRob = this.requester.route("anyroute")
|
||||
.data("rob")
|
||||
.retrieveMono(String.class)
|
||||
.block();
|
||||
|
||||
assertThat(hiRob).isEqualTo("Hi rob");
|
||||
}
|
||||
|
||||
private RSocketRequester.Builder requester() {
|
||||
return RSocketRequester.builder()
|
||||
.rsocketStrategies(this.handler.getRSocketStrategies());
|
||||
|
||||
Reference in New Issue
Block a user