diff options
author | Gadicherla, Shiva <sg592n@att.com> | 2020-01-24 21:54:17 +0000 |
---|---|---|
committer | Gadicherla, Shiva <sg592n@att.com> | 2020-01-30 19:38:39 +0000 |
commit | 950bed75318edc958d763eaee1d0c7a493e3dbd2 (patch) | |
tree | 4dfffef4092034e38fed7216c3d7d0470cdd2eb5 /music-core/src/main/java | |
parent | c2efe177fb1f418734e7d3d7ece32e7ddd97a640 (diff) |
JUnit test case coverage for Condition.java, JsonLock.java, MusicLockState.java, MusicCore.java
Issue-ID: MUSIC-521
Signed-off-by: Gadicherla, Shiva <shiva.gadicherla@att.com>
Change-Id: I02aa0986b89883514ae2a001ec00006f0f28c3e8
Diffstat (limited to 'music-core/src/main/java')
-rw-r--r-- | music-core/src/main/java/org/onap/music/datastore/Condition.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/music-core/src/main/java/org/onap/music/datastore/Condition.java b/music-core/src/main/java/org/onap/music/datastore/Condition.java index 6587748e..c17d9c07 100644 --- a/music-core/src/main/java/org/onap/music/datastore/Condition.java +++ b/music-core/src/main/java/org/onap/music/datastore/Condition.java @@ -23,7 +23,7 @@ package org.onap.music.datastore; import java.util.Map; - +import org.onap.music.exceptions.MusicServiceException; import org.onap.music.main.MusicCore; import com.datastax.driver.core.ResultSet; @@ -40,7 +40,7 @@ public class Condition { public boolean testCondition() throws Exception { // first generate the row - ResultSet results = MusicCore.quorumGet(selectQueryForTheRow); + ResultSet results = quorumGet(selectQueryForTheRow); Row row = null; if(results != null) { row = results.one(); @@ -48,6 +48,16 @@ public class Condition { if(row == null) { throw new Exception(" No data found to update"); } - return MusicDataStoreHandle.getDSHandle().doesRowSatisfyCondition(row, conditions); + return getDSHandle().doesRowSatisfyCondition(row, conditions); + } + + /* For JUnit testing only */ + public ResultSet quorumGet(PreparedQueryObject selectQueryForTheRow) { + return MusicCore.quorumGet(selectQueryForTheRow); + } + + /* For JUnit testing only */ + public MusicDataStore getDSHandle() throws MusicServiceException { + return MusicDataStoreHandle.getDSHandle(); } }
\ No newline at end of file |