October 2018
Intermediate to advanced
556 pages
15h 18m
English
Finally, the most uncommon verification is that of the Reactor's Context. We covered the role and mechanics of Context in Chapter 4, Project Reactor - the Foundation for Reactive Apps. Let's assume that we want to verify the reactive API of the authentication service. In order to authenticate a user, LoginService expects that a subscriber will provide a Context that holds the authentication information:
StepVerifier .create(securityService.login("admin", "admin"))
.expectSubscription()
.expectAccessibleContext()
.hasKey("security")
.then()
.expectComplete()
.verify();
In the preceding code, we can see how to check whether there is an accessible Context instance. We can see that there is only one case in which the ...
Read now
Unlock full access