### Question:
AssuranceController { @CrossOrigin(origins = "*") @GetMapping(path = "/assurance/orderid/{orderId}") public HttpEntity findAssuranceByOrderId(@PathVariable String orderId, @RequestHeader HttpHeaders headers) { return ok(assuranceService.findAssuranceByOrderId(UUID.fromString(orderId), headers)); }  @GetMapping(path = "/welcome") String home(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/assurances") HttpEntity getAllAssurances(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/assurances/types") HttpEntity getAllAssuranceType(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @DeleteMapping(path = "/assurances/assuranceid/{assuranceId}") HttpEntity deleteAssurance(@PathVariable String assuranceId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @DeleteMapping(path = "/assurances/orderid/{orderId}") HttpEntity deleteAssuranceByOrderId(@PathVariable String orderId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PatchMapping(path = "/assurances/{assuranceId}/{orderId}/{typeIndex}") HttpEntity modifyAssurance(@PathVariable String assuranceId,
                                      @PathVariable String orderId,
                                      @PathVariable int typeIndex, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/assurances/{typeIndex}/{orderId}") HttpEntity createNewAssurance(@PathVariable int typeIndex, @PathVariable String orderId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/assurances/assuranceid/{assuranceId}") HttpEntity getAssuranceById(@PathVariable String assuranceId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/assurance/orderid/{orderId}") HttpEntity findAssuranceByOrderId(@PathVariable String orderId, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testFindAssuranceByOrderId() throws Exception { UUID orderId = UUID.randomUUID(); Mockito.when(assuranceService.findAssuranceByOrderId(Mockito.any(UUID.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String result = mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/assuranceservice/assurance/orderid/" + orderId.toString())) .andExpect(MockMvcResultMatchers.status().isOk()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }