UserMgmtServerController { @RequestMapping(method = RequestMethod.POST, consumes = "application/json", produces = "application/json") @ResponseBody @RestCallPointcut public void add(@RequestBody @Valid UserMgmtServer serverInfo, @RequestParam(value = "testonly", required = false) boolean testOnly, @RequestParam(value = "forceTrustCert", required = false) boolean certConfirmed) { userMgmtServerService.add(serverInfo, testOnly, certConfirmed); }  @RequestMapping(method = RequestMethod.POST, consumes = "application/json", produces = "application/json") @ResponseBody @RestCallPointcut void add(@RequestBody @Valid UserMgmtServer serverInfo,
                   @RequestParam(value = "testonly", required = false) boolean testOnly,
                   @RequestParam(value = "forceTrustCert", required = false) boolean certConfirmed); @RequestMapping(value = "/{name}", method = RequestMethod.PUT, consumes = "application/json", produces = "application/json") @ResponseBody void modify(
         @PathVariable("name") @Valid @NotNull String name,
         @RequestBody @Valid UserMgmtServer serverInfo,
         @RequestParam(value = "testonly", required = false) boolean testOnly,
         @RequestParam(value = "forceTrustCert", required = false) boolean certConfirmed); @RequestMapping(value = "/{name}", method = RequestMethod.GET, produces = "application/json") @ResponseBody @RestCallPointcut UserMgmtServer getByName(@PathVariable("name") @Valid @NotNull String name); @RequestMapping(value = "/{name}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) @RestCallPointcut void delete(@PathVariable("name") @Valid @NotNull String name); @RequestMapping(value = "/enableLdap/{clusterName}", method = RequestMethod.POST, consumes = "application/json") @ResponseBody @RestCallPointcut void enableLdap(@PathVariable("clusterName") String clusterName);  }
@Test public void testAdd() throws Exception { UserMgmtServer userMgmtServer = objectMapper.readValue( new InputStreamReader(TestUserMgmtServerController.class.getResourceAsStream("/com/vmware/bdd/rest/ldap-server.json")), UserMgmtServer.class); MockHttpServletRequestBuilder builder = post("/vmconfig/usermgmtservers") .contentType(MediaType.APPLICATION_JSON).content(UnitTestUtil.convertObjectToJsonBytes(userMgmtServer)); ResultActions result = mockMvc.perform(builder); result.andDo(new ResultHandler() { @Override public void handle(MvcResult result) throws Exception { Assert.assertEquals(200, result.getResponse().getStatus()); Assert.assertEquals(0, result.getResponse().getContentLength()); } }); }