CustomerController { @GetMapping public ResponseEntity<List<Customer>> getCustomers() { final List<Customer> customers = this.customerService.getCustomers(); if (customers.isEmpty()) { return ResponseEntity.noContent().build(); } return new ResponseEntity<>(customers, HttpStatus.OK); }  @GetMapping ResponseEntity<List<Customer>> getCustomers(); @GetMapping(value = "{customerId}", produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity<Customer> getCustomer(@PathVariable("customerId") @NotBlank Long customerId); @PostMapping ResponseEntity<Object> createCustomer(@Valid @RequestBody Customer customer, UriComponentsBuilder ucBuilder,
			Errors errors); @PutMapping("{customerId}") ResponseEntity<Customer> updateCustomer(@RequestBody Customer updateCustomerRequest,
			@PathVariable("customerId") Long customerId); @DeleteMapping("{customerId}") ResponseEntity<Customer> removeCustomer(@PathVariable("customerId") Long customerId); @DeleteMapping ResponseEntity<Customer> deleteAllUsers();  }
@Test void testGetCustomers() throws Exception { given(this.customerService.getCustomers()).willReturn(Collections.singletonList(this.customer)); this.mockMvc.perform(MockMvcRequestBuilders.get("/rest/customers/")).andExpect(status().isOk()) .andExpect(jsonPath("[0].firstName").value("firstName")) .andExpect(jsonPath("[0].lastName").value("lastName")); }