aboutsummaryrefslogtreecommitdiffstats
path: root/music-core/src/main
diff options
context:
space:
mode:
authorBrendan Tschaen <ctschaen@att.com>2020-01-30 20:54:49 +0000
committerGerrit Code Review <gerrit@onap.org>2020-01-30 20:54:49 +0000
commit712f0dddc791f9ef8283fb40b5b5f326bc4ea0d9 (patch)
treeddc25cbe84f375b5b6a04d74f0bd75becde73775 /music-core/src/main
parent3e7717442eceb670bfa69ddb27c9abe68e99a920 (diff)
parent950bed75318edc958d763eaee1d0c7a493e3dbd2 (diff)
Merge "JUnit test case coverage for Condition.java, JsonLock.java, MusicLockState.java, MusicCore.java Issue-ID: MUSIC-521"
Diffstat (limited to 'music-core/src/main')
-rw-r--r--music-core/src/main/java/org/onap/music/datastore/Condition.java16
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