Added test
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120069 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f9b21e7f9e
commit
42ba6dc4c5
|
@ -54,7 +54,7 @@ public class AccountingPersistenceConfigurationTest {
|
|||
public static final String FAKE_USERNAME = "fakeusername";
|
||||
public static final String FAKE_PASSWORD = "fakepassword";
|
||||
|
||||
public static final String[] SCOPES = new String[]{"/gcube", "/gcube/devNext"};
|
||||
public static final String[] SCOPES = new String[]{"/gcube", "/gcube/devNext", "/gcube/devsec"};
|
||||
public static final String GCUBE_SCOPE = SCOPES[0];
|
||||
public static final String GCUBE_DEVNEXT_SCOPE = SCOPES[1];
|
||||
|
||||
|
@ -244,4 +244,24 @@ public class AccountingPersistenceConfigurationTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUsernamePasswordForScopes() throws Exception{
|
||||
for(String scope : SCOPES){
|
||||
ScopeProvider.instance.set(scope);
|
||||
try {
|
||||
AccountingPersistenceConfiguration persitenceConfiguration = new AccountingPersistenceConfiguration(COUCHDB_CLASS_NAME);
|
||||
logger.debug("{} {} - {} : {}", scope,
|
||||
persitenceConfiguration.getUri(),
|
||||
persitenceConfiguration.getUsername(),
|
||||
persitenceConfiguration.getPassword());
|
||||
}catch(IndexOutOfBoundsException e){
|
||||
logger.debug("No AccountingPersistenceConfiguration : \n {} {} \n\n", e.getClass().getName(), e.getMessage());
|
||||
} catch(Exception e){
|
||||
logger.error("Error getting AccountingPersistenceConfiguration", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue