cloud-native-spring-in-action
cloud-native-spring-in-action copied to clipboard
I find a blemish when I write slice test in chapter 12.3.2
- Through creating the
OrderControllerWebFluxTests
, I noticed thatReactiveJwtDecoder
MockBean
was ultimately not utilized. The same appears to be true forJwtDecoder
MockBean
within theBookControllerMvcTests
class insection 12.2.3
. These injections seem to be superfluous and may need to be reevaluated. - In my opinion, the endpoint in
OrderService
would be more logically protected under thecustomer
role, and there are a couple of reasons for this thought process: $\quad$ (1) Within theOrderControllerWebFluxTests
class, thewhenBookNotAvailableThenRejectOrder
method utilizeswebTestClient
to send a mock request with a mockjwt
holding theROLE_customer
authority. This test method would render moot if all requests were allowed to pass. $\quad$ (2) It seems unreasonable to me that aguest
should have the ability to submit an order without the appropriate permissions.
Therefore, restricting this action could be beneficial for our application control.