JobTemplate extends AbstractTemplate implements JobOperations { public void bookmarkJob(int id) { Map<String, Map<String,Integer>> jobDetails = new HashMap<String,Map<String,Integer>>(); Map<String,Integer>idDetails = new HashMap<String,Integer>(); jobDetails.put("job", idDetails); idDetails.put("id", id); restOperations.postForLocation(BOOKMARK_URL, jobDetails); } JobTemplate(RestOperations restOperations, ObjectMapper objectMapper ); Jobs searchJobs(JobSearchParameters parameters); Job getJob(int id); void bookmarkJob(int id); void unbookmarkJob(int id); Jobs getSuggestions(int start, int count); JobBookmarks getBookmarks(int start, int count); static final String BASE_URL; static final String FIELDS; static final String SEARCH_FIELDS; static final String SEARCH_URL; static final String JOB_URL; static final String BOOKMARK_URL; static final String BOOKMARKS_URL; static final String UNBOOKMARK_URL; static final String SUGGESTED_URL; }
@Test public void bookmark() { mockServer.expect(requestTo(JobTemplate.BOOKMARK_URL + "?oauth2_access_token=ACCESS_TOKEN")) .andExpect(method(POST)) .andExpect(content().string("{\"job\":{\"id\":123456}}")) .andRespond(withSuccess("", MediaType.APPLICATION_JSON)); linkedIn.jobOperations().bookmarkJob(123456); }