use of org.orcid.jaxb.model.client_v2.ClientSummary in project ORCID-Source by ORCID.
the class ClientManagerReadOnlyTest method getClientSummary.
private ClientSummary getClientSummary(String randomString) {
ClientSummary summary = new ClientSummary();
summary.setDescription("description " + randomString);
summary.setName("client-name " + randomString);
return summary;
}
use of org.orcid.jaxb.model.client_v2.ClientSummary in project ORCID-Source by ORCID.
the class ClientManagerReadOnlyTest method getSummaryTest.
@Test
public void getSummaryTest() {
String seed = RandomStringUtils.randomAlphanumeric(30);
when(daoMock.findByClientId(anyString(), anyLong())).thenReturn(getClientDetailsEntity(seed));
ClientSummary summary = clientManagerReadOnly.getSummary(seed);
assertEquals(getClientSummary(seed), summary);
}
use of org.orcid.jaxb.model.client_v2.ClientSummary in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorTest method testViewClient.
@Test
public void testViewClient() {
Response response = serviceDelegator.viewClient("APP-6666666666666666");
assertNotNull(response.getEntity());
assertTrue(response.getEntity() instanceof ClientSummary);
ClientSummary client = (ClientSummary) response.getEntity();
assertEquals("Source Client 2", client.getName());
assertEquals("A test source client", client.getDescription());
}
use of org.orcid.jaxb.model.client_v2.ClientSummary in project ORCID-Source by ORCID.
the class PublicV2ApiServiceVersionedDelegatorTest method testViewClient.
@Test
public void testViewClient() {
Response response = serviceDelegator.viewClient("APP-6666666666666666");
assertNotNull(response.getEntity());
assertTrue(response.getEntity() instanceof ClientSummary);
ClientSummary client = (ClientSummary) response.getEntity();
assertEquals("Source Client 2", client.getName());
assertEquals("A test source client", client.getDescription());
}
use of org.orcid.jaxb.model.client_v2.ClientSummary in project ORCID-Source by ORCID.
the class MemberV2ApiServiceDelegatorImpl method viewClient.
@Override
public Response viewClient(String clientId) {
orcidSecurityManager.checkScopes(ScopePathType.READ_PUBLIC);
ClientSummary client = clientManagerReadOnly.getSummary(clientId);
return Response.ok(client).build();
}
Aggregations