use of org.powerbot.bot.rt6.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method getClient.
private Client getClient() {
Client client = new Client();
client.setAllowAutoDeprecate(true);
client.setPersistentTokensEnabled(true);
client.setClientType(ClientType.CREATOR);
client.setDescription("description");
client.setGroupProfileId("group-profile-id");
client.setId("id");
client.setName("client-name");
client.setWebsite("client-website");
client.setAuthenticationProviderId("authentication-provider-id");
Set<ClientRedirectUri> clientRedirectUris = new HashSet<ClientRedirectUri>();
ClientRedirectUri rUri1 = new ClientRedirectUri();
Set<ScopePathType> scopes1 = new HashSet<ScopePathType>();
scopes1.add(ScopePathType.ACTIVITIES_READ_LIMITED);
rUri1.setPredefinedClientScopes(scopes1);
rUri1.setRedirectUri("redirect-uri-1");
rUri1.setRedirectUriType("type-1");
rUri1.setUriActType("uri-act-type-1");
rUri1.setUriGeoArea("uri-geo-area-1");
ClientRedirectUri rUri2 = new ClientRedirectUri();
Set<ScopePathType> scopes2 = new HashSet<ScopePathType>();
scopes2.add(ScopePathType.ACTIVITIES_UPDATE);
rUri2.setPredefinedClientScopes(scopes2);
rUri2.setRedirectUri("redirect-uri-2");
rUri2.setRedirectUriType("type-2");
rUri2.setUriActType("uri-act-type-2");
rUri2.setUriGeoArea("uri-geo-area-2");
ClientRedirectUri rUri3 = new ClientRedirectUri();
Set<ScopePathType> scopes3 = new HashSet<ScopePathType>();
scopes3.add(ScopePathType.AFFILIATIONS_CREATE);
rUri3.setPredefinedClientScopes(scopes3);
rUri3.setRedirectUri("redirect-uri-3");
rUri3.setRedirectUriType("type-3");
rUri3.setUriActType("uri-act-type-3");
rUri3.setUriGeoArea("uri-geo-area-3");
clientRedirectUris.add(rUri1);
clientRedirectUris.add(rUri2);
clientRedirectUris.add(rUri3);
client.setClientRedirectUris(clientRedirectUris);
return client;
}
use of org.powerbot.bot.rt6.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method toClientTest.
@Test
public void toClientTest() {
ClientDetailsEntity entity = getClientDetailsEntity();
Client client = adapter.toClient(entity);
assertEquals(getClient(), client);
}
use of org.powerbot.bot.rt6.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method toEntityTest.
@Test
public void toEntityTest() {
Client client = getClient();
ClientDetailsEntity entity = adapter.toEntity(client);
ClientDetailsEntity toCompare = getClientDetailsEntity();
// Configuration values should be the default
assertFalse(entity.isPersistentTokensEnabled());
assertNull(entity.getAuthenticationProviderId());
assertEquals(toCompare.getClientDescription(), entity.getClientDescription());
assertEquals(toCompare.getClientId(), entity.getClientId());
assertEquals(toCompare.getClientName(), entity.getClientName());
assertEquals(toCompare.getClientRegisteredRedirectUris(), entity.getClientRegisteredRedirectUris());
assertEquals(toCompare.getClientWebsite(), entity.getClientWebsite());
assertEquals(toCompare.isAllowAutoDeprecate(), entity.isAllowAutoDeprecate());
assertFalse(entity.isPersistentTokensEnabled());
assertNull(entity.getClientType());
assertNull(entity.getAuthenticationProviderId());
assertNull(entity.getEmailAccessReason());
assertNull(entity.getGroupProfileId());
assertNull(entity.getClientSecrets());
assertEquals(Collections.EMPTY_SET, entity.getClientAuthorizedGrantTypes());
assertEquals(Collections.EMPTY_SET, entity.getClientResourceIds());
assertEquals(Collections.EMPTY_SET, entity.getClientScopes());
assertEquals(Collections.EMPTY_SET, entity.getCustomEmails());
assertEquals(Collections.EMPTY_LIST, entity.getClientGrantedAuthorities());
}
use of org.powerbot.bot.rt6.client.Client in project ORCID-Source by ORCID.
the class ClientManagerReadOnlyTest method getClientTest.
@Test
public void getClientTest() {
String seed = RandomStringUtils.randomAlphanumeric(30);
when(daoMock.findByClientId(anyString(), anyLong())).thenReturn(getClientDetailsEntity(seed));
Client client = clientManagerReadOnly.get(seed);
assertEquals(getClient(seed), client);
}
use of org.powerbot.bot.rt6.client.Client in project hpcourse by cscenter.
the class SimpleTests method submitHardTask.
public void submitHardTask() {
new Thread(new Runnable() {
@Override
public void run() {
Client client = new Client("localhost", 1500);
client.submitTask(getHardTask());
}
}).start();
}
Aggregations