From 26e801767d2ed995f3263eae37b25cbfdd1fa42d Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 21 Dec 2021 12:06:15 +0100 Subject: [PATCH] improved logs --- .../geoportalcommon/GNADataEntryConfigProfileReader.java | 2 +- .../gcube/application/geoportalcommon/GeoportalCommon.java | 7 ++++--- src/test/java/org/gcube/application/TestGNACommon.java | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java b/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java index 3e179f7..9dacfaa 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java +++ b/src/main/java/org/gcube/application/geoportalcommon/GNADataEntryConfigProfileReader.java @@ -69,8 +69,8 @@ public class GNADataEntryConfigProfileReader { protected GNADataEntryConfigProfile readProfileFromInfrastrucure() throws Exception { LOG.info("called readProfileFromInfrastrucure"); String queryString = getGcubeGenericQueryString(SECONDARY_TYPE, GENERIC_RESOURCE_NAME); - LOG.info("Scope " + scope + ", trying to perform query: " + queryString); this.scope = ScopeProvider.instance.get(); + LOG.info("Scope " + scope + ", trying to perform query: " + queryString); if (scope == null) throw new Exception("Scope is null, set scope into ScopeProvider"); diff --git a/src/main/java/org/gcube/application/geoportalcommon/GeoportalCommon.java b/src/main/java/org/gcube/application/geoportalcommon/GeoportalCommon.java index 5b18dbd..3571ef7 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/GeoportalCommon.java +++ b/src/main/java/org/gcube/application/geoportalcommon/GeoportalCommon.java @@ -165,12 +165,13 @@ public class GeoportalCommon { * @throws Exception the exception */ public GNADataViewerConfigProfile readGNADataViewConfig(String appID) throws Exception { - LOG.info("getGeoNaDataViewProfile called for: " + appID); + LOG.info("getGeoNaDataViewProfile called for AppID: " + appID); - if (appID == null || appID.isEmpty()) + if (appID == null || appID.isEmpty()) { + LOG.info("AppID is null, so using DEFAULT: " + appID); appID = GeoportalCommonConstants.GEOPORTAL_DATA_VIEWER_APP; + } - LOG.info("using AppId: " + appID); GNADataViewerConfigProfileReader gdvp = new GNADataViewerConfigProfileReader(appID); GNADataViewerConfigProfile profile = gdvp.readProfileFromInfrastrucure(); LOG.info("Returning profile: " + profile); diff --git a/src/test/java/org/gcube/application/TestGNACommon.java b/src/test/java/org/gcube/application/TestGNACommon.java index d1d2e28..32bcf59 100644 --- a/src/test/java/org/gcube/application/TestGNACommon.java +++ b/src/test/java/org/gcube/application/TestGNACommon.java @@ -20,10 +20,11 @@ import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.common.scope.api.ScopeProvider; import org.junit.Before; +import org.junit.Test; public class TestGNACommon { - private static String TOKEN = ""; + private static String TOKEN = "8e74a17c-92f1-405a-b591-3a6090066248-98187548"; private static String CONTEXT = "/gcube/devsec/devVRE"; private static String USERNAME = "francesco.mangiacrapa"; @@ -91,7 +92,7 @@ public class TestGNACommon { } - // @Test + @Test public void readGNDataEntryConfigsFromIS() throws Exception { GeoportalCommon r = new GeoportalCommon(); @@ -115,7 +116,7 @@ public class TestGNACommon { } } - // @Test + //@Test public void readGNDataViewerConfigsFromIS() throws Exception { GeoportalCommon r = new GeoportalCommon();