...
/Testing Our HypermediaItemController
Testing Our HypermediaItemController
Learn how to test the hypermedia-based web service we created.
We'll cover the following...
We'll cover the following...
Using Spring REST Docs, this web controller can be tested, just like the plain old JSON API was. Let’s look at a new test we created. We’re only focusing on the hypermedia controller.
@WebFluxTest(controllers = HypermediaItemController.class)@AutoConfigureRestDocspublic class HypermediaItemControllerDocumentationTest {@Autowired private WebTestClient webTestClient;@MockBean InventoryService service;@MockBean ItemRepository repository;}
Building hypermedia for a single Item
Once again, the setup for a documentation test case is identical. The only difference is that we point it at the HypermediaItemController
. The bottom line is that capturing HTTP ...