use of org.orcid.jaxb.model.v3.dev1.record.summary.InvitedPositions in project ORCID-Source by ORCID.
the class PublicV3ApiServiceDelegatorTest method testGetPublicInvitedPositions.
@Test
public void testGetPublicInvitedPositions() {
Response r = serviceDelegator.viewInvitedPositions(ORCID);
assertNotNull(r);
InvitedPositions invitedPositions = (InvitedPositions) r.getEntity();
assertNotNull(invitedPositions);
assertNotNull(invitedPositions.getLastModifiedDate());
assertNotNull(invitedPositions.getLastModifiedDate().getValue());
assertNotNull(invitedPositions.getSummaries());
assertEquals(1, invitedPositions.getSummaries().size());
assertEquals(Long.valueOf(32), invitedPositions.getSummaries().get(0).getPutCode());
assertEquals(Visibility.PUBLIC, invitedPositions.getSummaries().get(0).getVisibility());
assertNotNull(invitedPositions.getSummaries().get(0).getLastModifiedDate());
assertNotNull(invitedPositions.getSummaries().get(0).getLastModifiedDate().getValue());
}
use of org.orcid.jaxb.model.v3.dev1.record.summary.InvitedPositions in project ORCID-Source by ORCID.
the class PublicV3ApiServiceDelegatorTest method testViewInvitedPositions.
@Test
public void testViewInvitedPositions() {
Response response = serviceDelegator.viewInvitedPositions(ORCID);
assertNotNull(response);
InvitedPositions invitedPositions = (InvitedPositions) response.getEntity();
assertNotNull(invitedPositions);
assertEquals("/0000-0000-0000-0003/invited-positions", invitedPositions.getPath());
assertNotNull(invitedPositions.getLastModifiedDate());
assertNotNull(invitedPositions.getLastModifiedDate().getValue());
assertEquals(1, invitedPositions.getSummaries().size());
InvitedPositionSummary invitedPosition = invitedPositions.getSummaries().get(0);
assertEquals(Long.valueOf(32), invitedPosition.getPutCode());
assertNotNull(invitedPosition.getLastModifiedDate());
assertNotNull(invitedPosition.getLastModifiedDate().getValue());
assertEquals("/0000-0000-0000-0003/invited-position/32", invitedPosition.getPath());
assertEquals("PUBLIC Department", invitedPosition.getDepartmentName());
assertEquals(Visibility.PUBLIC.value(), invitedPosition.getVisibility().value());
assertEquals("APP-5555555555555555", invitedPosition.getSource().retrieveSourcePath());
}
use of org.orcid.jaxb.model.v3.dev1.record.summary.InvitedPositions in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV3Test method getInvitedPositions.
private InvitedPositions getInvitedPositions(Visibility... vs) {
InvitedPositions e = new InvitedPositions();
for (Visibility v : vs) {
InvitedPositionSummary s = new InvitedPositionSummary();
s.setVisibility(v);
e.getSummaries().add(s);
}
return e;
}
use of org.orcid.jaxb.model.v3.dev1.record.summary.InvitedPositions in project ORCID-Source by ORCID.
the class PublicAPISecurityManagerV3Test method filterInvitedPositionsTest.
@Test
public void filterInvitedPositionsTest() {
InvitedPositions e = getInvitedPositions(Visibility.PUBLIC, Visibility.PUBLIC, Visibility.PUBLIC);
assertEquals(3, e.getSummaries().size());
publicAPISecurityManagerV3.filter(e);
assertEquals(3, e.getSummaries().size());
assertContainerContainsOnlyPublicElements(e);
e = getInvitedPositions(Visibility.PUBLIC, Visibility.PUBLIC, Visibility.LIMITED);
assertEquals(3, e.getSummaries().size());
publicAPISecurityManagerV3.filter(e);
assertEquals(2, e.getSummaries().size());
assertContainerContainsOnlyPublicElements(e);
e = getInvitedPositions(Visibility.PUBLIC, Visibility.LIMITED, Visibility.PRIVATE);
assertEquals(3, e.getSummaries().size());
publicAPISecurityManagerV3.filter(e);
assertEquals(1, e.getSummaries().size());
assertContainerContainsOnlyPublicElements(e);
e = getInvitedPositions(Visibility.PRIVATE, Visibility.LIMITED, Visibility.PRIVATE);
assertEquals(3, e.getSummaries().size());
publicAPISecurityManagerV3.filter(e);
assertTrue(e.getSummaries().isEmpty());
}
use of org.orcid.jaxb.model.v3.dev1.record.summary.InvitedPositions in project ORCID-Source by ORCID.
the class ActivityUtilsTest method setPathToInvitedPositionsTest.
@Test
public void setPathToInvitedPositionsTest() {
InvitedPositions x = getInvitedPositions();
ActivityUtils.setPathToAffiliations(x, ORCID);
assertEquals("/" + ORCID + "/invited-position/123", x.getSummaries().get(0).getPath());
}
Aggregations