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:
Luca Frosini 2015-10-28 15:37:08 +00:00
parent f9b21e7f9e
commit 42ba6dc4c5
1 changed files with 21 additions and 1 deletions

View File

@ -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;
}
}
}
}