use of org.orcid.internal.util.LastModifiedResponse in project ORCID-Source by ORCID.
the class InternalApiServiceDelegatorImpl method viewPersonLastModified.
@Override
@AccessControl(requiredScope = ScopePathType.INTERNAL_PERSON_LAST_MODIFIED, requestComesFromInternalApi = true)
public Response viewPersonLastModified(String orcid) {
Date lastModified = orcidProfileManager.retrieveLastModifiedDate(orcid);
LastModifiedResponse obj = new LastModifiedResponse(orcid, lastModified.toString());
Response response = Response.ok(obj).build();
return response;
}
use of org.orcid.internal.util.LastModifiedResponse in project ORCID-Source by ORCID.
the class InternalApiServiceDelegatorTest method viewLastModified.
@Test
public void viewLastModified() {
Response response = internalApiServiceDelegator.viewPersonLastModified(USER_ORCID);
assertNotNull(response);
assertNotNull(response.getEntity());
assertTrue(response.getEntity().getClass().isAssignableFrom(LastModifiedResponse.class));
LastModifiedResponse obj = (LastModifiedResponse) response.getEntity();
assertNotNull(obj);
assertEquals(USER_ORCID, obj.getOrcid());
assertEquals(orcidProfileManager.retrieveLastModifiedDate(USER_ORCID).toString(), obj.getLastModified());
}
Aggregations