### Question:
ContactsController { @CrossOrigin(origins = "*") @PostMapping(path = "/contacts") public ResponseEntity<Response> createNewContacts(@RequestBody Contacts aci, @RequestHeader HttpHeaders headers) { ContactsController.LOGGER.info("[ContactsService][VerifyLogin] Success"); return new ResponseEntity<>(contactsService.create(aci, headers), HttpStatus.CREATED); }  @GetMapping(path = "/contacts/welcome") String home(); @CrossOrigin(origins = "*") @GetMapping(path = "/contacts") HttpEntity getAllContacts(@RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(path = "/contacts") ResponseEntity<Response> createNewContacts(@RequestBody Contacts aci,
                                                      @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PostMapping(path = "/contacts/admin") HttpEntity<?> createNewContactsAdmin(@RequestBody Contacts aci, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @DeleteMapping(path = "/contacts/{contactsId}") HttpEntity deleteContacts(@PathVariable String contactsId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @PutMapping(path = "/contacts") HttpEntity modifyContacts(@RequestBody Contacts info, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/contacts/account/{accountId}") HttpEntity findContactsByAccountId(@PathVariable String accountId, @RequestHeader HttpHeaders headers); @CrossOrigin(origins = "*") @GetMapping(path = "/contacts/{id}") HttpEntity getContactsByContactsId(@PathVariable String id, @RequestHeader HttpHeaders headers);  }### Answer:
@Test public void testCreateNewContacts() throws Exception { Contacts aci = new Contacts(); Mockito.when(contactsService.create(Mockito.any(Contacts.class), Mockito.any(HttpHeaders.class))).thenReturn(response); String requestJson = JSONObject.toJSONString(aci); String result = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/contactservice/contacts").contentType(MediaType.APPLICATION_JSON).content(requestJson)) .andExpect(MockMvcResultMatchers.status().isCreated()) .andReturn().getResponse().getContentAsString(); Assert.assertEquals(response, JSONObject.parseObject(result, Response.class)); }