Search in sources :

Example 6 with ClientRedirectUri

use of org.orcid.jaxb.model.client_v2.ClientRedirectUri in project ORCID-Source by ORCID.

the class ClientManagerTest method getClient.

private Client getClient(String randomString, String memberId) {
    Client client = new Client();
    client.setAllowAutoDeprecate(true);
    client.setAuthenticationProviderId("authentication-provider-id " + randomString);
    client.setClientType(ClientType.CREATOR);
    client.setDescription("description " + randomString);
    client.setEmailAccessReason("email-access-reason " + randomString);
    client.setGroupProfileId(memberId);
    client.setId(randomString);
    client.setName("client-name " + randomString);
    client.setPersistentTokensEnabled(true);
    client.setWebsite("client-website " + randomString);
    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 " + randomString);
    rUri1.setRedirectUriType("type-1 " + randomString);
    rUri1.setUriActType("uri-act-type-1 " + randomString);
    rUri1.setUriGeoArea("uri-geo-area-1 " + randomString);
    ClientRedirectUri rUri2 = new ClientRedirectUri();
    Set<ScopePathType> scopes2 = new HashSet<ScopePathType>();
    scopes2.add(ScopePathType.ACTIVITIES_UPDATE);
    rUri2.setPredefinedClientScopes(scopes2);
    rUri2.setRedirectUri("redirect-uri-2 " + randomString);
    rUri2.setRedirectUriType("type-2 " + randomString);
    rUri2.setUriActType("uri-act-type-2 " + randomString);
    rUri2.setUriGeoArea("uri-geo-area-2 " + randomString);
    ClientRedirectUri rUri3 = new ClientRedirectUri();
    Set<ScopePathType> scopes3 = new HashSet<ScopePathType>();
    scopes3.add(ScopePathType.AFFILIATIONS_CREATE);
    rUri3.setPredefinedClientScopes(scopes3);
    rUri3.setRedirectUri("redirect-uri-3 " + randomString);
    rUri3.setRedirectUriType("type-3 " + randomString);
    rUri3.setUriActType("uri-act-type-3 " + randomString);
    rUri3.setUriGeoArea("uri-geo-area-3 " + randomString);
    clientRedirectUris.add(rUri1);
    clientRedirectUris.add(rUri2);
    clientRedirectUris.add(rUri3);
    client.setClientRedirectUris(clientRedirectUris);
    return client;
}
Also used : ClientRedirectUri(org.orcid.jaxb.model.client_v2.ClientRedirectUri) ScopePathType(org.orcid.jaxb.model.message.ScopePathType) Client(org.orcid.jaxb.model.client_v2.Client) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)6 Client (org.orcid.jaxb.model.client_v2.Client)6 ClientRedirectUri (org.orcid.jaxb.model.client_v2.ClientRedirectUri)6 ScopePathType (org.orcid.jaxb.model.message.ScopePathType)5 Date (java.util.Date)3 ClientDetailsEntity (org.orcid.persistence.jpa.entities.ClientDetailsEntity)3 Test (org.junit.Test)2 BaseTest (org.orcid.core.BaseTest)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeSet (java.util.TreeSet)1 MapperFactory (ma.glasnost.orika.MapperFactory)1 MappingContext (ma.glasnost.orika.MappingContext)1 DefaultMapperFactory (ma.glasnost.orika.impl.DefaultMapperFactory)1 ClientSummary (org.orcid.jaxb.model.client_v2.ClientSummary)1 FuzzyDate (org.orcid.jaxb.model.common_v2.FuzzyDate)1 PublicationDate (org.orcid.jaxb.model.common_v2.PublicationDate)1 ClientRedirectUriEntity (org.orcid.persistence.jpa.entities.ClientRedirectUriEntity)1 ClientSecretEntity (org.orcid.persistence.jpa.entities.ClientSecretEntity)1