X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=music-rest%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fmusic%2Fmain%2FPropertiesLoader.java;h=11dc51dd3e8620f1c75ff3ad8682a5f266298cb8;hb=0c173cdf44af313e376f1e8ae4fd6e6973c6c20b;hp=9c69b9e297add5381355870cc39784d64f6ebc71;hpb=a40b03fe9039d247dcc5a366f9778155a92c947b;p=music.git diff --git a/music-rest/src/main/java/org/onap/music/main/PropertiesLoader.java b/music-rest/src/main/java/org/onap/music/main/PropertiesLoader.java index 9c69b9e2..11dc51dd 100644 --- a/music-rest/src/main/java/org/onap/music/main/PropertiesLoader.java +++ b/music-rest/src/main/java/org/onap/music/main/PropertiesLoader.java @@ -33,7 +33,8 @@ import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.stereotype.Component; -@PropertySource(value = {"file:/opt/app/music/etc/music.properties", "classpath:/project.properties","file:/opt/app/music/etc/key.properties"}) +@PropertySource(value = {"file:/opt/app/music/etc/music.properties", "classpath:/project.properties"}) +//"file:/opt/app/music/etc/key.properties" @Component public class PropertiesLoader implements InitializingBean { @@ -90,7 +91,7 @@ public class PropertiesLoader implements InitializingBean { @Value("${create.lock.wait.increment.ms}") private int createLockWaitIncrement; - + @Value("${transId.header.prefix}") private String transIdPrefix; @@ -118,7 +119,7 @@ public class PropertiesLoader implements InitializingBean { @Value("${music.aaf.ns}") private String musicAafNs; - @Value("${cipher.enc.key}") + @Value("${cipher.enc.key:}") private String cipherEncKey; @SuppressWarnings("unused") @@ -340,5 +341,33 @@ public class PropertiesLoader implements InitializingBean { // TODO Auto-generated method stub } + + /* For unit testing purpose only*/ + protected void setProperties() { + cassandraHost = "127.0.0.1"; + debug = "true"; + version = "x.x.x"; + build = "y.y"; + musicProperties = "property"; + lockLeasePeriod = "5000"; + cassandraUser = "user"; + cassandraPassword = "password"; + cassandraPort = "8007"; + cassandraConnectTimeOutMS = "1000"; + cassandraReadTimeOutMS = "1000"; + isCadi = "true"; + isKeyspaceActive = "true"; + rertryCount = "20"; + transIdPrefix = "transId-"; + conversationIdPrefix = "conversation-"; + clientIdPrefix = "clientId-"; + messageIdPrefix = "messageId-"; + transIdRequired = true; + conversationIdRequired = true; + clientIdRequired = true; + messageIdRequired = true; + musicAafNs = "ns"; + cipherEncKey = "key"; + } }