use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method filterKeywordsTest.
@Test
public void filterKeywordsTest() {
Keywords x = getKeywordsElement(Visibility.PUBLIC, Visibility.PUBLIC, Visibility.PUBLIC);
assertEquals(3, x.getKeywords().size());
publicAPISecurityManagerV2.filter(x);
assertEquals(3, x.getKeywords().size());
assertAllArePublic(x.getKeywords());
x = getKeywordsElement(Visibility.PUBLIC, Visibility.PUBLIC, Visibility.LIMITED);
assertEquals(3, x.getKeywords().size());
publicAPISecurityManagerV2.filter(x);
assertEquals(2, x.getKeywords().size());
assertAllArePublic(x.getKeywords());
x = getKeywordsElement(Visibility.PUBLIC, Visibility.LIMITED, Visibility.PRIVATE);
assertEquals(3, x.getKeywords().size());
publicAPISecurityManagerV2.filter(x);
assertEquals(1, x.getKeywords().size());
assertAllArePublic(x.getKeywords());
x = getKeywordsElement(Visibility.PRIVATE, Visibility.LIMITED, Visibility.PRIVATE);
assertEquals(3, x.getKeywords().size());
publicAPISecurityManagerV2.filter(x);
assertTrue(x.getKeywords().isEmpty());
}
use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method checkIsPublicPersonTest.
@Test
public void checkIsPublicPersonTest() {
Person p = getPersonElement();
publicAPISecurityManagerV2.filter(p);
// Nothing is filtered yet
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// Addresses filtered
p = getPersonElement();
setVisibility(p.getAddresses().getAddress(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
// --- filtered ---
assertNotNull(p.getAddresses());
assertTrue(p.getAddresses().getAddress().isEmpty());
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// Bio filtered
p = getPersonElement();
p.getBiography().setVisibility(Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
// --- filtered ---
assertNull(p.getBiography());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// Emails filtered
p = getPersonElement();
setVisibility(p.getEmails().getEmails(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
// --- filtered ---
assertNotNull(p.getEmails());
assertTrue(p.getEmails().getEmails().isEmpty());
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// External ids filtered
p = getPersonElement();
setVisibility(p.getExternalIdentifiers().getExternalIdentifiers(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
// --- filtered ---
assertNotNull(p.getExternalIdentifiers());
assertTrue(p.getExternalIdentifiers().getExternalIdentifiers().isEmpty());
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// Keywords filtered
p = getPersonElement();
setVisibility(p.getKeywords().getKeywords(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
// --- filtered ---
assertNotNull(p.getKeywords());
assertTrue(p.getKeywords().getKeywords().isEmpty());
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// Name filtered
p = getPersonElement();
p.getName().setVisibility(Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
// --- filtered ---
assertNull(p.getName());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// Other names filtered
p = getPersonElement();
setVisibility(p.getOtherNames().getOtherNames(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
// --- filtered ---
assertNotNull(p.getOtherNames());
assertTrue(p.getOtherNames().getOtherNames().isEmpty());
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
p.getResearcherUrls().getResearcherUrls().forEach(e -> assertIsPublic(e));
// Researcher urls filtered
p = getPersonElement();
setVisibility(p.getResearcherUrls().getResearcherUrls(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(p);
assertEquals(3, p.getAddresses().getAddress().size());
p.getAddresses().getAddress().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getBiography().getVisibility());
assertEquals(3, p.getEmails().getEmails().size());
p.getEmails().getEmails().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
p.getExternalIdentifiers().getExternalIdentifiers().forEach(e -> assertIsPublic(e));
assertEquals(3, p.getKeywords().getKeywords().size());
p.getKeywords().getKeywords().forEach(e -> assertIsPublic(e));
assertEquals(Visibility.PUBLIC, p.getName().getVisibility());
assertEquals(3, p.getOtherNames().getOtherNames().size());
p.getOtherNames().getOtherNames().forEach(e -> assertIsPublic(e));
// --- filtered ---
assertNotNull(p.getResearcherUrls());
assertTrue(p.getResearcherUrls().getResearcherUrls().isEmpty());
}
use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV2Test method checkIsPublicRecordTest.
@Test
public void checkIsPublicRecordTest() {
Record r = getRecordElement();
publicAPISecurityManagerV2.filter(r);
// Verify activities - nothing filtered
ActivitiesSummary as = r.getActivitiesSummary();
assertEquals(3, as.getEducations().getSummaries().size());
assertContainerContainsOnlyPublicElements(as.getEducations());
assertEquals(3, as.getEmployments().getSummaries().size());
assertContainerContainsOnlyPublicElements(as.getEmployments());
assertEquals(3, as.getFundings().getFundingGroup().size());
assertGroupContainsOnlyPublicElements(as.getFundings());
assertEquals(3, as.getPeerReviews().getPeerReviewGroup().size());
assertGroupContainsOnlyPublicElements(as.getPeerReviews());
assertEquals(3, as.getWorks().getWorkGroup().size());
assertGroupContainsOnlyPublicElements(as.getWorks());
// Verify bio sections - nothing filtered
Person p = r.getPerson();
assertEquals(3, p.getAddresses().getAddress().size());
assertAllArePublic(p.getAddresses().getAddress());
assertEquals(3, p.getEmails().getEmails().size());
assertAllArePublic(p.getEmails().getEmails());
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
assertAllArePublic(p.getExternalIdentifiers().getExternalIdentifiers());
assertEquals(3, p.getKeywords().getKeywords().size());
assertAllArePublic(p.getKeywords().getKeywords());
assertEquals(3, p.getOtherNames().getOtherNames().size());
assertAllArePublic(p.getOtherNames().getOtherNames());
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
assertAllArePublic(p.getResearcherUrls().getResearcherUrls());
assertNotNull(p.getBiography());
assertNotNull(p.getName());
// Filter biography, name, educations and funding
r = getRecordElement();
r.getPerson().getBiography().setVisibility(Visibility.LIMITED);
r.getPerson().getName().setVisibility(Visibility.LIMITED);
setVisibility(r.getActivitiesSummary().getEducations().getSummaries(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
setVisibility(r.getActivitiesSummary().getFundings(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(r);
// Verify activities - educations and funding filtered
as = r.getActivitiesSummary();
assertNotNull(as.getEducations());
assertTrue(as.getEducations().getSummaries().isEmpty());
assertEquals(3, as.getEmployments().getSummaries().size());
assertTrue(as.getFundings().getFundingGroup().isEmpty());
assertEquals(3, as.getPeerReviews().getPeerReviewGroup().size());
assertEquals(3, as.getWorks().getWorkGroup().size());
// Verify bio sections - bio and name filtered
p = r.getPerson();
assertEquals(3, p.getAddresses().getAddress().size());
assertEquals(3, p.getEmails().getEmails().size());
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
assertEquals(3, p.getKeywords().getKeywords().size());
assertEquals(3, p.getOtherNames().getOtherNames().size());
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
assertNull(p.getBiography());
assertNull(p.getName());
// Filter emails, external identifiers, peer reviews and works
r = getRecordElement();
setVisibility(r.getPerson().getEmails().getEmails(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
setVisibility(r.getPerson().getExternalIdentifiers().getExternalIdentifiers(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
setVisibility(r.getActivitiesSummary().getPeerReviews(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
setVisibility(r.getActivitiesSummary().getWorks(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(r);
// Verify activities - peer reviews and works filtered
as = r.getActivitiesSummary();
assertEquals(3, as.getEducations().getSummaries().size());
assertEquals(3, as.getEmployments().getSummaries().size());
assertEquals(3, as.getFundings().getFundingGroup().size());
assertTrue(as.getPeerReviews().getPeerReviewGroup().isEmpty());
assertTrue(as.getWorks().getWorkGroup().isEmpty());
// Verify bio sections - emails, external identifiers filtered
p = r.getPerson();
assertEquals(3, p.getAddresses().getAddress().size());
assertNotNull(p.getEmails());
assertTrue(p.getEmails().getEmails().isEmpty());
assertNotNull(p.getExternalIdentifiers());
assertTrue(p.getExternalIdentifiers().getExternalIdentifiers().isEmpty());
assertEquals(3, p.getKeywords().getKeywords().size());
assertEquals(3, p.getOtherNames().getOtherNames().size());
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
assertNotNull(p.getBiography());
assertNotNull(p.getName());
// Filter keywords and other names
r = getRecordElement();
setVisibility(r.getPerson().getOtherNames().getOtherNames(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
setVisibility(r.getPerson().getKeywords().getKeywords(), Visibility.LIMITED, Visibility.PRIVATE, Visibility.LIMITED);
publicAPISecurityManagerV2.filter(r);
// Verify activities - nothing filtered
as = r.getActivitiesSummary();
assertEquals(3, as.getEducations().getSummaries().size());
assertEquals(3, as.getEmployments().getSummaries().size());
assertEquals(3, as.getFundings().getFundingGroup().size());
assertEquals(3, as.getPeerReviews().getPeerReviewGroup().size());
assertEquals(3, as.getWorks().getWorkGroup().size());
// Verify bio sections - keywords and other names filtered
p = r.getPerson();
assertEquals(3, p.getAddresses().getAddress().size());
assertEquals(3, p.getEmails().getEmails().size());
assertEquals(3, p.getExternalIdentifiers().getExternalIdentifiers().size());
assertNotNull(p.getKeywords());
assertTrue(p.getKeywords().getKeywords().isEmpty());
assertNotNull(p.getOtherNames());
assertTrue(p.getOtherNames().getOtherNames().isEmpty());
assertEquals(3, p.getResearcherUrls().getResearcherUrls().size());
assertNotNull(p.getBiography());
assertNotNull(p.getName());
}
use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.
the class OrcidInfo method groupKeywords.
private LinkedHashMap<String, List<Keyword>> groupKeywords(Keywords keywords) {
if (keywords == null || keywords.getKeywords() == null) {
return null;
}
/* Grouping items */
LinkedHashMap<String, List<Keyword>> groups = new LinkedHashMap<String, List<Keyword>>();
for (Keyword k : keywords.getKeywords()) {
if (groups.containsKey(k.getContent())) {
groups.get(k.getContent()).add(k);
} else {
List<Keyword> list = new ArrayList<Keyword>();
list.add(k);
groups.put(k.getContent(), list);
}
}
return groups;
}
use of org.orcid.jaxb.model.record_v2.Keywords in project ORCID-Source by ORCID.
the class KeywordsTest method testCreateGetUpdateAndDeleteKeyword_rc3.
/**
* --------- -- -- -- RC3 -- -- -- ---------
*
*/
@SuppressWarnings({ "deprecation", "rawtypes" })
@Test
public void testCreateGetUpdateAndDeleteKeyword_rc3() throws InterruptedException, JSONException {
changeDefaultUserVisibility(org.orcid.jaxb.model.common_v2.Visibility.LIMITED);
changeCurrentKeywordsVisibility(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC);
String accessToken = getAccessToken();
assertNotNull(accessToken);
org.orcid.jaxb.model.record_rc3.Keyword newKeyword = new org.orcid.jaxb.model.record_rc3.Keyword();
newKeyword.setContent("keyword-3");
newKeyword.setVisibility(org.orcid.jaxb.model.common_rc3.Visibility.PUBLIC);
// Create
ClientResponse response = memberV2ApiClient_rc3.createKeyword(getUser1OrcidId(), newKeyword, accessToken);
assertNotNull(response);
assertEquals(ClientResponse.Status.CREATED.getStatusCode(), response.getStatus());
Map map = response.getMetadata();
assertNotNull(map);
assertTrue(map.containsKey("Location"));
List resultWithPutCode = (List) map.get("Location");
String location = resultWithPutCode.get(0).toString();
Long putCode = Long.valueOf(location.substring(location.lastIndexOf('/') + 1));
// Get all and verify
response = memberV2ApiClient_rc3.viewKeywords(getUser1OrcidId(), accessToken);
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
Keywords keywords = response.getEntity(Keywords.class);
assertNotNull(keywords);
assertNotNull(keywords.getKeywords());
boolean found1 = false;
boolean found2 = false;
boolean foundNew = false;
for (org.orcid.jaxb.model.record_rc3.Keyword existingKeyword : keywords.getKeywords()) {
if (existingKeyword.getContent().equals(keyword1)) {
assertEquals(org.orcid.jaxb.model.common_rc3.Visibility.PUBLIC, existingKeyword.getVisibility());
found1 = true;
} else if (existingKeyword.getContent().equals(keyword2)) {
assertEquals(org.orcid.jaxb.model.common_rc3.Visibility.PUBLIC, existingKeyword.getVisibility());
found2 = true;
} else if (existingKeyword.getContent().equals(newKeyword.getContent())) {
assertEquals(org.orcid.jaxb.model.common_rc3.Visibility.LIMITED, existingKeyword.getVisibility());
assertEquals("keyword-3", existingKeyword.getContent());
assertEquals(getClient1ClientId(), existingKeyword.getSource().retrieveSourcePath());
foundNew = true;
}
}
assertTrue(found1);
assertTrue(found2);
assertTrue(foundNew);
// Get it
response = memberV2ApiClient_rc3.viewKeyword(getUser1OrcidId(), putCode, accessToken);
assertNotNull(response);
newKeyword = response.getEntity(Keyword.class);
assertNotNull(newKeyword);
assertNotNull(newKeyword.getSource());
assertEquals(getClient1ClientId(), newKeyword.getSource().retrieveSourcePath());
assertEquals("keyword-3", newKeyword.getContent());
assertEquals(org.orcid.jaxb.model.common_rc3.Visibility.LIMITED, newKeyword.getVisibility());
assertNotNull(newKeyword.getDisplayIndex());
Long originalDisplayIndex = newKeyword.getDisplayIndex();
// Save the original visibility
org.orcid.jaxb.model.common_rc3.Visibility originalVisibility = newKeyword.getVisibility();
org.orcid.jaxb.model.common_rc3.Visibility updatedVisibility = org.orcid.jaxb.model.common_rc3.Visibility.PRIVATE;
// Verify you cant update the visibility
newKeyword.setVisibility(updatedVisibility);
ClientResponse putResponse = memberV2ApiClient_rc3.updateKeyword(getUser1OrcidId(), newKeyword, accessToken);
assertEquals(Response.Status.FORBIDDEN.getStatusCode(), putResponse.getStatus());
org.orcid.jaxb.model.error_rc3.OrcidError error = putResponse.getEntity(org.orcid.jaxb.model.error_rc3.OrcidError.class);
assertNotNull(error);
assertEquals(Integer.valueOf(9035), error.getErrorCode());
// Set the visibility again to the initial one
newKeyword.setVisibility(originalVisibility);
// Update
newKeyword.setContent("keyword-3-updated");
response = memberV2ApiClient_rc3.updateKeyword(getUser1OrcidId(), newKeyword, accessToken);
assertNotNull(response);
assertEquals(ClientResponse.Status.OK.getStatusCode(), response.getStatus());
response = memberV2ApiClient_rc3.viewKeyword(getUser1OrcidId(), putCode, accessToken);
assertNotNull(response);
org.orcid.jaxb.model.record_rc3.Keyword updatedKeyword = response.getEntity(Keyword.class);
assertNotNull(updatedKeyword);
assertEquals("keyword-3-updated", updatedKeyword.getContent());
assertEquals(newKeyword.getPutCode(), updatedKeyword.getPutCode());
assertEquals(originalDisplayIndex, updatedKeyword.getDisplayIndex());
// Delete
response = memberV2ApiClient_rc3.deleteKeyword(getUser1OrcidId(), putCode, accessToken);
assertNotNull(response);
assertEquals(ClientResponse.Status.NO_CONTENT.getStatusCode(), response.getStatus());
}
Aggregations