use of org.orcid.jaxb.model.record_rc3.WorkBulk in project ORCID-Source by ORCID.
the class WorksTest method testCreateBulkWork.
@Test
public void testCreateBulkWork() throws InterruptedException, JSONException {
String accessToken = getAccessToken();
WorkBulk bulk = createBulk(10, null);
ClientResponse postResponse = memberV2_1ApiClient.createWorksJson(this.getUser1OrcidId(), bulk, accessToken);
assertNotNull(postResponse);
assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
bulk = postResponse.getEntity(WorkBulk.class);
assertNotNull(bulk);
assertNotNull(bulk.getBulk());
// All elements might be ok
for (BulkElement element : bulk.getBulk()) {
assertTrue(Work.class.isAssignableFrom(element.getClass()));
Work work = (Work) element;
// Remove the work
memberV2_1ApiClient.deleteWorkXml(this.getUser1OrcidId(), work.getPutCode(), accessToken);
}
}
Aggregations