Code Review
/
music.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Junit test case coverage for some classes in music-rest
[music.git]
/
music-rest
/
src
/
main
/
java
/
org
/
onap
/
music
/
eelf
/
healthcheck
/
MusicHealthCheck.java
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
fbfc0de
..
acbbdd1
100644
(file)
--- 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,10
+94,15
@@
public class MusicHealthCheck {
pQuery.appendQueryString("insert into admin.healthcheck (id) values (?)");
pQuery.addValue(randomUUID);
ResultType rs = null;
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;
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 {
}
private void cleanHealthCheckId(UUID randomUUID) throws MusicServiceException, MusicQueryException {
@@
-105,11
+110,14
@@
public class MusicHealthCheck {
PreparedQueryObject deleteQueryObject = new PreparedQueryObject();
deleteQueryObject.appendQueryString(cleanQuery);
deleteQueryObject.addValue(randomUUID);
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.");
}
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();
private boolean createKeyspace() throws MusicServiceException,MusicQueryException {
PreparedQueryObject pQuery = new PreparedQueryObject();