CustomerController { @DeleteMapping("{customerId}") public ResponseEntity<Customer> removeCustomer(@PathVariable("customerId") Long customerId) throws EntityNotFoundException { log.info("Fetching & Deleting User with id {}", customerId); this.customerService.deleteCustomerById(customerId); return ResponseEntity.accepted().build(); }  @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 @WithMockUser(roles = "ADMIN") void testRemoveCustomer() throws Exception { BDDMockito.willDoNothing().given(this.customerService).deleteCustomerById(ArgumentMatchers.anyLong()); this.mockMvc.perform(MockMvcRequestBuilders.delete("/rest/customers/{customerId}", RandomUtils.nextLong())) .andExpect(status().isAccepted()); }