AnnotationService extends EndpointService { public PutResult putAnnotations(List<Annotation> annotations) throws IOException, TokenExpiredException { String requestUrl = COLLECTION_RESOURCE + RESOURCE; ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.POST, requestUrl, annotations); assertValidResponse(response, requestUrl); Map<String, Object> map = fromJson(response.getResult(), new TypeReference<Map<String, Object>>() { }); List<String> errorMessages = (List<String>) map.get("Error Messages"); return new PutResult(String.valueOf(map.get("Success")), String.valueOf(map.get("Errors")), errorMessages); } AnnotationService(ArgusHttpClient client); List<Annotation> getAnnotations(List<String> expressions); PutResult putAnnotations(List<Annotation> annotations);  }
@Test public void testPutAnnotations() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/AnnotationServiceTest.json"))) { AnnotationService annotationService = argusService.getAnnotationService(); List<Annotation> annotations = Arrays.asList(new Annotation[] { _constructAnnotation() }); PutResult result = annotationService.putAnnotations(annotations); assertEquals(_constructSuccessfulResult(annotations, 0), result); } }