aboutsummaryrefslogtreecommitdiffstats
path: root/music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
diff options
context:
space:
mode:
authorGadicherla, Shiva <sg592n@att.com>2020-03-02 21:15:50 +0000
committerGadicherla, Shiva <sg592n@att.com>2020-03-02 22:09:52 +0000
commit7fda9bd76272ba4712fa810632ce252dfafe3363 (patch)
treebbc2974ac1f78de3077a7a14bf83330dc3e47dd2 /music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
parent9399b2eed91169c719acd9a966b4c5ed560897a8 (diff)
Junit test case coverage for some classes in music-rest
Issue-ID: MUSIC-521 Signed-off-by: Gadicherla, Shiva <shiva.gadicherla@att.com> Change-Id: I3be0da4c0f9e2cb052e9f2dcd3ce5931b8f59d9a
Diffstat (limited to 'music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java')
-rw-r--r--music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java b/music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
index fbfc0de6..acbbdd18 100644
--- a/music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
+++ b/music-rest/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
@@ -94,22 +94,30 @@ public class MusicHealthCheck {
pQuery.appendQueryString("insert into admin.healthcheck (id) values (?)");
pQuery.addValue(randomUUID);
ResultType rs = null;
- rs = MusicCore.nonKeyRelatedPut(pQuery, consistency);
+ rs = nonKeyRelatedPut(pQuery, consistency);
logger.info(rs.toString());
return null != rs;
}
+
+ /*For unit testing purpose only*/
+ public ResultType nonKeyRelatedPut(PreparedQueryObject pQuery, String consistency) throws MusicServiceException, MusicQueryException {
+ return MusicCore.nonKeyRelatedPut(pQuery, consistency);
+ }
private void cleanHealthCheckId(UUID randomUUID) throws MusicServiceException, MusicQueryException {
String cleanQuery = "delete from admin.healthcheck where id = ?";
PreparedQueryObject deleteQueryObject = new PreparedQueryObject();
deleteQueryObject.appendQueryString(cleanQuery);
deleteQueryObject.addValue(randomUUID);
- MusicDataStoreHandle.getDSHandle().executePut(deleteQueryObject, "eventual");
+ executeEventualPut(deleteQueryObject);
logger.info(EELFLoggerDelegate.applicationLogger, "Cassandra healthcheck responded and cleaned up.");
}
-
+ /*For unit testing purpose only*/
+ public void executeEventualPut(PreparedQueryObject deleteQueryObject) throws MusicServiceException, MusicQueryException {
+ MusicDataStoreHandle.getDSHandle().executePut(deleteQueryObject, "eventual");
+ }
private boolean createKeyspace() throws MusicServiceException,MusicQueryException {
PreparedQueryObject pQuery = new PreparedQueryObject();