From 42ba6dc4c5020ce1d5e4199fabc871ca7b5c2770 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 28 Oct 2015 15:37:08 +0000 Subject: [PATCH] Added test git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120069 82a268e6-3cf1-43bd-a215-b396298e98cf --- ...ccountingPersistenceConfigurationTest.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/gcube/accounting/persistence/AccountingPersistenceConfigurationTest.java b/src/test/java/org/gcube/accounting/persistence/AccountingPersistenceConfigurationTest.java index 868afa6..9b8f730 100644 --- a/src/test/java/org/gcube/accounting/persistence/AccountingPersistenceConfigurationTest.java +++ b/src/test/java/org/gcube/accounting/persistence/AccountingPersistenceConfigurationTest.java @@ -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; + } + } + } + + }