October 2018
Intermediate to advanced
590 pages
15h 5m
English
In Chapter 7, RESTful API Design - Building Language Between Frontend and Backend, we created the unit test class, MessageControllerTest. In this section, we will use the same approach to create the RegistrationApiControllerTests class. To test the register(RegistrationPayload) method, we will need to provide the input via Spring's MockMvc, and mock its dependency, UserService. In this way, we can verify the behavior of this API handler.
Now we're clear what need to do, let's add the following test methods that will cover four different scenarios:
Read now
Unlock full access