Fixes at the end
Here are the fixes in this chapter:
- Fix—adding/registering to request mapping: If you run the
mvn spring-boot:run
command after a clean install and then open the page athttps://localhost:8080/register,
you will see a404
error page. This is because we haven't added/register
to@GetMapping
insideMainController
. Let's fix it now. Once it is fixed, try to perform a registration from the register page. After registration, you should see the debug information thatUserRegisteredEventHandler
created.
Not adding /register
to the mapping reveals a defect in our end-to-end testing. The end-to-end test is supposed to capture this kind of issue during building. Unfortunately, it didn't. We will improve our end-to-end testing in the next chapter. The following is the commit record:
Figure 9.14: Fix—add/register to request mapping commit
- Fix—invalid return value of
encrypt()
method: In our implementation ofPasswordEncryptor
,PasswordEncryptorDelegator
, theencrypt()
method returns anull
value...