From 9cd6659574e58aae87a8aa40feaad492b2f3bde7 Mon Sep 17 00:00:00 2001 From: "Nelson,Thomas(tn1381)(arthurdent3)" Date: Tue, 27 Mar 2018 19:50:44 -0400 Subject: Code Coverage, Auth ID, Docker Change-Id: If9212aea5a643f2db6c18090f17cd2da71f5a968 Issue-ID: MUSIC-44, MUSIC-65, MUSIC-56 Signed-off-by: Nelson,Thomas(tn1381)(arthurdent3) --- src/main/java/org/onap/music/main/CachingUtil.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/onap/music/main/CachingUtil.java') diff --git a/src/main/java/org/onap/music/main/CachingUtil.java b/src/main/java/org/onap/music/main/CachingUtil.java index 2a105c24..b59e81b3 100755 --- a/src/main/java/org/onap/music/main/CachingUtil.java +++ b/src/main/java/org/onap/music/main/CachingUtil.java @@ -45,6 +45,7 @@ import com.att.eelf.configuration.EELFLogger; import com.datastax.driver.core.DataType; import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Row; +import com.datastax.driver.core.exceptions.InvalidQueryException; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; @@ -241,7 +242,13 @@ public class CachingUtil implements Runnable { pQuery.appendQueryString( "SELECT is_aaf from admin.keyspace_master where application_name = '" + namespace + "' allow filtering"); - Row rs = MusicCore.get(pQuery).one(); + Row rs = null; + try { + rs = MusicCore.get(pQuery).one(); + } catch(InvalidQueryException e) { + logger.error(EELFLoggerDelegate.errorLogger,"Exception admin keyspace not configured."+e.getMessage()); + throw new MusicServiceException("Please make sure admin.keyspace_master table is configured."); + } try { isAAF = String.valueOf(rs.getBool("is_aaf")); if(isAAF != null) @@ -333,7 +340,11 @@ public class CachingUtil implements Runnable { e.printStackTrace(); resultMap.put("Exception", "Unable to process operation. Error is "+e.getMessage()); return resultMap; - } + } catch (InvalidQueryException e) { + logger.error(EELFLoggerDelegate.errorLogger,"Exception admin keyspace not configured."+e.getMessage()); + resultMap.put("Exception", "Please make sure admin.keyspace_master table is configured."); + return resultMap; + } if (rs == null) { logger.error(EELFLoggerDelegate.errorLogger,"Application is not onboarded. Please contact admin."); resultMap.put("Exception", "Application is not onboarded. Please contact admin."); -- cgit 1.2.3-korg