RaxaPatientAccessController extends BaseRestController { @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New Relationship") @ResponseBody public Object createNewRelationship(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response) throws ResponseException { initRelationshipController(); validatePost(post); Relationship relationship = createRelationshipFromPost(post); relationship = service.saveRelationship(relationship); return RestUtil.created(response, getRelationshipAsSimpleObject(relationship)); }  void initRelationshipController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New Relationship") @ResponseBody Object createNewRelationship(@RequestBody SimpleObject post, HttpServletRequest request,
	        HttpServletResponse response); @RequestMapping(method = RequestMethod.GET, params = "fromPerson") @WSDoc("Gets Full representation of Relationships for the given parameters") @ResponseBody() String getRelationships(@RequestParam Map<String, String> params, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Relationship for the uuid path") @ResponseBody() String getRelationshipByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Relationships in the system") @ResponseBody() String getAllRelationships(HttpServletRequest request, HttpServletResponse response);  }
@Test public void testCreateNewRelationship() throws Exception { int before = service.getAllRelationships(true).size(); String json = "{\"fromPerson\":\"a7e04421-525f-442f-8138-05b619d16def\",\"toPerson\":\"5946f880-b197-400b-9caa-a3c661d23041\",\"relationshipType\":\"Doctor/Patient\"}"; SimpleObject post = new ObjectMapper().readValue(json, SimpleObject.class); Object drug = controller.createNewRelationship(post, request, response); Assert.assertEquals(before + 1, service.getAllRelationships(true).size()); }