aboutsummaryrefslogtreecommitdiffstats
path: root/music-core/src/main
diff options
context:
space:
mode:
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