aboutsummaryrefslogtreecommitdiffstats
path: root/music-core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'music-core/src/test')
-rw-r--r--music-core/src/test/java/LICENSE.txt24
-rw-r--r--music-core/src/test/java/org/onap/music/datastore/PreparedQueryObjectTest.java101
-rw-r--r--music-core/src/test/java/org/onap/music/eelf/logging/format/AppMessagesTest.java65
-rw-r--r--music-core/src/test/java/org/onap/music/exceptions/MusicLockingExceptionTest.java104
-rw-r--r--music-core/src/test/java/org/onap/music/exceptions/MusicPolicyVoilationExceptionTest.java106
-rw-r--r--music-core/src/test/java/org/onap/music/exceptions/MusicQueryExceptionTest.java118
-rw-r--r--music-core/src/test/java/org/onap/music/exceptions/MusicServiceExceptionTest.java145
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/CassandraCQL.java247
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/MusicUtilTest.java332
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/ResultTypeTest.java43
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/ReturnTypeTest.java84
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java44
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java86
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java111
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java73
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java47
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java56
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java100
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java111
-rw-r--r--music-core/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java48
-rw-r--r--music-core/src/test/resources/LICENSE.txt24
-rw-r--r--music-core/src/test/resources/Resources.properties50
-rw-r--r--music-core/src/test/resources/application.properties2
-rw-r--r--music-core/src/test/resources/cache.ccf62
-rw-r--r--music-core/src/test/resources/logback.xml302
-rw-r--r--music-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker1
-rw-r--r--music-core/src/test/resources/mockito-extensions/org.mockito.plugins.StackTraceCleanerProvider1
-rw-r--r--music-core/src/test/resources/project.properties4
28 files changed, 2491 insertions, 0 deletions
diff --git a/music-core/src/test/java/LICENSE.txt b/music-core/src/test/java/LICENSE.txt
new file mode 100644
index 00000000..cc6cdea5
--- /dev/null
+++ b/music-core/src/test/java/LICENSE.txt
@@ -0,0 +1,24 @@
+
+The following license applies to all files in this and sub-directories. Licenses
+are included in individual source files where appropriate, and if it differs
+from this text, it supersedes this. Any file that does not have license text
+defaults to being covered by this text; not all files support the addition of
+licenses.
+#
+# -------------------------------------------------------------------------
+# Copyright (c) 2017 AT&T Intellectual Property
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# -------------------------------------------------------------------------
+# \ No newline at end of file
diff --git a/music-core/src/test/java/org/onap/music/datastore/PreparedQueryObjectTest.java b/music-core/src/test/java/org/onap/music/datastore/PreparedQueryObjectTest.java
new file mode 100644
index 00000000..7ab7d148
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/datastore/PreparedQueryObjectTest.java
@@ -0,0 +1,101 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * e
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.datastore;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class PreparedQueryObjectTest {
+
+ private PreparedQueryObject preparedQueryObject;
+
+ @Before
+ public void setUp()
+ {
+ preparedQueryObject = new PreparedQueryObject();
+ }
+
+ @Test
+ public void testKeyspaceName()
+ {
+ preparedQueryObject.setKeyspaceName("keyspaceName");
+ assertEquals("keyspaceName", preparedQueryObject.getKeyspaceName());
+ }
+
+ @Test
+ public void testConsistency()
+ {
+ preparedQueryObject.setConsistency("consistency");
+ assertEquals("consistency", preparedQueryObject.getConsistency());
+ }
+
+ @Test
+ public void testTableName()
+ {
+ preparedQueryObject.setTableName("tableName");
+ assertEquals("tableName", preparedQueryObject.getTableName());
+ }
+
+ @Test
+ public void testoperation()
+ {
+ preparedQueryObject.setOperation("operation");
+ assertEquals("operation", preparedQueryObject.getOperation());
+ }
+
+ @Test
+ public void testprimaryKeyValue()
+ {
+ preparedQueryObject.setPrimaryKeyValue("primaryKeyValue");
+ assertEquals("primaryKeyValue", preparedQueryObject.getPrimaryKeyValue());
+ }
+
+ @Test
+ public void testAddValue() {
+ preparedQueryObject.addValue("one");
+ assertEquals("one", preparedQueryObject.getValues().get(0));
+ }
+
+ @Test
+ public void testAddValues() {
+ preparedQueryObject.addValues("one", "two", "three");
+ assertEquals(3, preparedQueryObject.getValues().size());
+ assertEquals("two", preparedQueryObject.getValues().get(1));
+ }
+
+ @Test
+ public void testConstructorQuery() {
+ preparedQueryObject = new PreparedQueryObject("some query string");
+ assertEquals("some query string", preparedQueryObject.getQuery());
+ }
+
+ @Test
+ public void testConstructorQueryValues() {
+ preparedQueryObject = new PreparedQueryObject("another query string", "a", "b", "c");
+ assertEquals("another query string", preparedQueryObject.getQuery());
+ assertEquals(3, preparedQueryObject.getValues().size());
+ assertEquals("b", preparedQueryObject.getValues().get(1));
+ }
+}
diff --git a/music-core/src/test/java/org/onap/music/eelf/logging/format/AppMessagesTest.java b/music-core/src/test/java/org/onap/music/eelf/logging/format/AppMessagesTest.java
new file mode 100644
index 00000000..cba9c7c2
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/eelf/logging/format/AppMessagesTest.java
@@ -0,0 +1,65 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ */
+
+package org.onap.music.eelf.logging.format;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class AppMessagesTest {
+
+ private AppMessages messages;
+
+ @Before
+ public void setUp() {
+ messages= AppMessages.ALREADYEXIST;
+ }
+
+ @Test
+ public void testDetails()
+ {
+ messages.setDetails("details");
+ assertEquals("details", messages.getDetails());
+ }
+
+ @Test
+ public void testResolution()
+ {
+ messages.setResolution("Resolution");
+ assertEquals("Resolution", messages.getResolution());
+ }
+
+ @Test
+ public void testErrorCode()
+ {
+ messages.setErrorCode("ErrorCode");
+ assertEquals("ErrorCode", messages.getErrorCode());
+ }
+
+ @Test
+ public void testErrorDescription()
+ {
+ messages.setErrorDescription("ErrorDescription");
+ assertEquals("ErrorDescription", messages.getErrorDescription());
+ }
+}
diff --git a/music-core/src/test/java/org/onap/music/exceptions/MusicLockingExceptionTest.java b/music-core/src/test/java/org/onap/music/exceptions/MusicLockingExceptionTest.java
new file mode 100644
index 00000000..583a9fd4
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/exceptions/MusicLockingExceptionTest.java
@@ -0,0 +1,104 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+package org.onap.music.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class MusicLockingExceptionTest {
+
+ @Test
+ public void TestException1() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicLockingException();
+ }
+ } catch (MusicLockingException mle) {
+ assertEquals("org.onap.music.exceptions.MusicLockingException", mle.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException2() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicLockingException("MusicLockingException Exception occured..");
+ }
+ } catch (MusicLockingException mle) {
+ assertEquals(mle.getMessage(), "MusicLockingException Exception occured..");
+ }
+
+ }
+
+ @Test
+ public void TestException3() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicLockingException(new Throwable());
+ }
+ } catch (MusicLockingException mle) {
+ assertEquals("org.onap.music.exceptions.MusicLockingException", mle.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException4() {
+ String message = "Exception occured";
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicLockingException(message, new Throwable());
+ }
+ } catch (MusicLockingException mle) {
+ assertEquals("org.onap.music.exceptions.MusicLockingException", mle.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException5() {
+ String message = "Exception occured";
+ boolean enableSuppression = true;
+ boolean writableStackTrace = false;
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicLockingException(message, new Throwable(), enableSuppression, writableStackTrace);
+ }
+ } catch (MusicLockingException mle) {
+ assertEquals("org.onap.music.exceptions.MusicLockingException", mle.getClass().getName());
+ }
+
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/exceptions/MusicPolicyVoilationExceptionTest.java b/music-core/src/test/java/org/onap/music/exceptions/MusicPolicyVoilationExceptionTest.java
new file mode 100644
index 00000000..22e2d728
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/exceptions/MusicPolicyVoilationExceptionTest.java
@@ -0,0 +1,106 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class MusicPolicyVoilationExceptionTest {
+
+ @Test
+ public void TestException1() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicPolicyVoilationException();
+ }
+ } catch (MusicPolicyVoilationException mve) {
+ assertEquals("org.onap.music.exceptions.MusicPolicyVoilationException", mve.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException2() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicPolicyVoilationException("MusicPolicyVoilationException Exception occured..");
+ }
+ } catch (MusicPolicyVoilationException mve) {
+ assertEquals(mve.getMessage(), "MusicPolicyVoilationException Exception occured..");
+ }
+
+ }
+
+ @Test
+ public void TestException3() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicPolicyVoilationException(new Throwable());
+ }
+ } catch (MusicPolicyVoilationException mve) {
+ assertEquals("org.onap.music.exceptions.MusicPolicyVoilationException", mve.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException4() {
+ String message = "Exception occured";
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicPolicyVoilationException(message, new Throwable());
+ }
+ } catch (MusicPolicyVoilationException mve) {
+ assertEquals("org.onap.music.exceptions.MusicPolicyVoilationException", mve.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException5() {
+ String message = "Exception occured";
+ boolean enableSuppression = true;
+ boolean writableStackTrace = false;
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicPolicyVoilationException(message, new Throwable(), enableSuppression,
+ writableStackTrace);
+ }
+ } catch (MusicPolicyVoilationException mve) {
+ assertEquals("org.onap.music.exceptions.MusicPolicyVoilationException", mve.getClass().getName());
+ }
+
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/exceptions/MusicQueryExceptionTest.java b/music-core/src/test/java/org/onap/music/exceptions/MusicQueryExceptionTest.java
new file mode 100644
index 00000000..9096506a
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/exceptions/MusicQueryExceptionTest.java
@@ -0,0 +1,118 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+package org.onap.music.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class MusicQueryExceptionTest {
+
+ @Test
+ public void TestException1() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicQueryException();
+ }
+ } catch (MusicQueryException mqe) {
+ assertEquals("org.onap.music.exceptions.MusicQueryException", mqe.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException2() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicQueryException("MusicQueryException Exception occured..");
+ }
+ } catch (MusicQueryException mqe) {
+ assertEquals(mqe.getMessage(), "MusicQueryException Exception occured..");
+ }
+
+ }
+
+ @Test
+ public void TestException3() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicQueryException("MusicQueryException Exception occured..", 001);
+ }
+ } catch (MusicQueryException mqe) {
+ assertEquals(mqe.getMessage(), "MusicQueryException Exception occured..");
+ }
+
+ }
+
+ @Test
+ public void TestException4() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicQueryException(new Throwable());
+ }
+ } catch (MusicQueryException mqe) {
+ assertEquals("org.onap.music.exceptions.MusicQueryException", mqe.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException5() {
+ String message = "Exception occured";
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicQueryException(message, new Throwable());
+ }
+ } catch (MusicQueryException mqe) {
+ assertEquals("org.onap.music.exceptions.MusicQueryException", mqe.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException6() {
+ String message = "Exception occured";
+ boolean enableSuppression = true;
+ boolean writableStackTrace = false;
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicQueryException(message, new Throwable(), enableSuppression, writableStackTrace);
+ }
+ } catch (MusicQueryException mqe) {
+ assertEquals("org.onap.music.exceptions.MusicQueryException", mqe.getClass().getName());
+ }
+
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/exceptions/MusicServiceExceptionTest.java b/music-core/src/test/java/org/onap/music/exceptions/MusicServiceExceptionTest.java
new file mode 100644
index 00000000..bf056b61
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/exceptions/MusicServiceExceptionTest.java
@@ -0,0 +1,145 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+package org.onap.music.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class MusicServiceExceptionTest {
+ @Test
+ public void TestException1() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicServiceException();
+ }
+ } catch (MusicServiceException mse) {
+ assertEquals("org.onap.music.exceptions.MusicServiceException", mse.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException2() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicServiceException("MusicServiceException Exception occured..");
+ }
+ } catch (MusicServiceException mse) {
+ assertEquals(mse.getMessage(), "MusicServiceException Exception occured..");
+ }
+
+ }
+
+ @Test
+ public void TestException3() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicServiceException("MusicServiceException Exception occured..", 001);
+ }
+ } catch (MusicServiceException mse) {
+ assertEquals(mse.getMessage(), "MusicServiceException Exception occured..");
+ }
+
+ }
+
+ @Test
+ public void TestException4() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicServiceException("MusicServiceException Exception occured..", 001, "errorMsg");
+ }
+ } catch (MusicServiceException mse) {
+ assertEquals(mse.getMessage(), "MusicServiceException Exception occured..");
+ }
+
+ }
+
+ @Test
+ public void TestException5() {
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicServiceException(new Throwable());
+ }
+ } catch (MusicServiceException mse) {
+ assertEquals("org.onap.music.exceptions.MusicServiceException", mse.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException6() {
+ String message = "Exception occured";
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicServiceException(message, new Throwable());
+ }
+ } catch (MusicServiceException mse) {
+ assertEquals("org.onap.music.exceptions.MusicServiceException", mse.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void TestException7() {
+ String message = "Exception occured";
+ boolean enableSuppression = true;
+ boolean writableStackTrace = false;
+ String s1 = "Value1";
+ String s2 = "value2";
+ try {
+ if (!s1.equalsIgnoreCase(s2)) {
+ throw new MusicServiceException(message, new Throwable(), enableSuppression, writableStackTrace);
+ }
+ } catch (MusicServiceException mse) {
+ assertEquals("org.onap.music.exceptions.MusicServiceException", mse.getClass().getName());
+ }
+
+ }
+
+ @Test
+ public void testErrorCode() {
+ MusicServiceException musicServiceException = new MusicServiceException();
+ musicServiceException.setErrorCode(0001);
+ assertEquals(0001, musicServiceException.getErrorCode());
+ }
+
+ @Test
+ public void testSetErrorMsg() {
+ MusicServiceException musicServiceException = new MusicServiceException();
+ musicServiceException.setErrorMessage("errorMsg");
+ assertEquals("errorMsg", musicServiceException.getErrorMessage());
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/CassandraCQL.java b/music-core/src/test/java/org/onap/music/unittests/CassandraCQL.java
new file mode 100644
index 00000000..7b116bc8
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/CassandraCQL.java
@@ -0,0 +1,247 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests;
+
+/**
+ * @author srupane
+ *
+ */
+
+import java.math.BigInteger;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+//import org.apache.thrift.transport.TTransportException;
+import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
+import org.onap.music.datastore.MusicDataStore;
+import org.onap.music.datastore.PreparedQueryObject;
+import org.onap.music.lockingservice.cassandra.LockType;
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.extras.codecs.enums.EnumNameCodec;
+
+public class CassandraCQL {
+ public static final String createAdminKeyspace = "CREATE KEYSPACE admin WITH REPLICATION = "
+ + "{'class' : 'SimpleStrategy' , 'replication_factor': 1} AND DURABLE_WRITES = true";
+
+ public static final String createAdminTable = "CREATE TABLE admin.keyspace_master (" + " uuid uuid, keyspace_name text,"
+ + " application_name text, is_api boolean,"
+ + " password text, username text,"
+ + " is_aaf boolean, PRIMARY KEY (uuid)\n" + ");";
+
+ public static final String createKeySpace =
+ "CREATE KEYSPACE IF NOT EXISTS testcassa WITH replication = "
+ +"{'class':'SimpleStrategy','replication_factor':1} AND durable_writes = true;";
+
+ public static final String dropKeyspace = "DROP KEYSPACE IF EXISTS testcassa";
+
+ public static final String createTableEmployees =
+ "CREATE TABLE IF NOT EXISTS testcassa.employees "
+ + "(vector_ts text,empid uuid,empname text,empsalary varint,address Map<text,text>,PRIMARY KEY (empname)) "
+ + "WITH comment='Financial Info of employees' "
+ + "AND compression={'sstable_compression':'DeflateCompressor','chunk_length_kb':64} "
+ + "AND compaction={'class':'SizeTieredCompactionStrategy','min_threshold':6};";
+
+ public static final String insertIntoTablePrepared1 =
+ "INSERT INTO testcassa.employees (vector_ts,empid,empname,empsalary) VALUES (?,?,?,?); ";
+
+ public static final String insertIntoTablePrepared2 =
+ "INSERT INTO testcassa.employees (vector_ts,empid,empname,empsalary,address) VALUES (?,?,?,?,?);";
+
+ public static final String selectALL = "SELECT * FROM testcassa.employees;";
+
+ public static final String selectSpecific =
+ "SELECT * FROM testcassa.employees WHERE empname= ?;";
+
+ public static final String updatePreparedQuery =
+ "UPDATE testcassa.employees SET vector_ts=?,address= ? WHERE empname= ?;";
+
+ public static final String deleteFromTable = " ";
+
+ public static final String deleteFromTablePrepared = " ";
+
+ // Set Values for Prepared Query
+
+ public static List<Object> setPreparedInsertValues1() {
+
+ List<Object> preppreparedInsertValues1 = new ArrayList<>();
+ String vectorTs =
+ String.valueOf(Thread.currentThread().getId() + System.currentTimeMillis());
+ UUID empId = UUID.fromString("abc66ccc-d857-4e90-b1e5-df98a3d40cd6");
+ BigInteger empSalary = BigInteger.valueOf(23443);
+ String empName = "Mr Test one";
+ preppreparedInsertValues1.add(vectorTs);
+ preppreparedInsertValues1.add(empId);
+ preppreparedInsertValues1.add(empName);
+ preppreparedInsertValues1.add(empSalary);
+ return preppreparedInsertValues1;
+ }
+
+ public static List<Object> setPreparedInsertValues2() {
+
+ List<Object> preparedInsertValues2 = new ArrayList<>();
+ String vectorTs =
+ String.valueOf(Thread.currentThread().getId() + System.currentTimeMillis());
+ UUID empId = UUID.fromString("abc434cc-d657-4e90-b4e5-df4223d40cd6");
+ BigInteger empSalary = BigInteger.valueOf(45655);
+ String empName = "Mr Test two";
+ Map<String, String> address = new HashMap<>();
+ preparedInsertValues2.add(vectorTs);
+ preparedInsertValues2.add(empId);
+ preparedInsertValues2.add(empName);
+ preparedInsertValues2.add(empSalary);
+ address.put("Street", "1 some way");
+ address.put("City", "Some town");
+ preparedInsertValues2.add(address);
+ return preparedInsertValues2;
+ }
+
+ public static List<Object> setPreparedUpdateValues() {
+
+ List<Object> preparedUpdateValues = new ArrayList<>();
+ String vectorTs =
+ String.valueOf(Thread.currentThread().getId() + System.currentTimeMillis());
+ Map<String, String> address = new HashMap<>();
+ preparedUpdateValues.add(vectorTs);
+ String empName = "Mr Test one";
+ address.put("Street", "101 Some Way");
+ address.put("City", "New York");
+ preparedUpdateValues.add(address);
+ preparedUpdateValues.add(empName);
+ return preparedUpdateValues;
+ }
+
+ // Generate Different Prepared Query Objects
+ /**
+ * Query Object for Get.
+ *
+ * @return
+ */
+ public static PreparedQueryObject setPreparedGetQuery() {
+
+ PreparedQueryObject queryObject = new PreparedQueryObject();
+ String empName1 = "Mr Test one";
+ queryObject.appendQueryString(selectSpecific);
+ queryObject.addValue(empName1);
+ return queryObject;
+ }
+
+ /**
+ * Query Object 1 for Insert.
+ *
+ * @return {@link PreparedQueryObject}
+ */
+ public static PreparedQueryObject setPreparedInsertQueryObject1() {
+
+ PreparedQueryObject queryobject = new PreparedQueryObject();
+ queryobject.appendQueryString(insertIntoTablePrepared1);
+ List<Object> values = setPreparedInsertValues1();
+ if (!values.isEmpty() || values != null) {
+ for (Object o : values) {
+ queryobject.addValue(o);
+ }
+ }
+ return queryobject;
+
+ }
+
+ /**
+ * Query Object 2 for Insert.
+ *
+ * @return {@link PreparedQueryObject}
+ */
+ public static PreparedQueryObject setPreparedInsertQueryObject2() {
+
+ PreparedQueryObject queryobject = new PreparedQueryObject();
+ queryobject.appendQueryString(insertIntoTablePrepared2);
+ List<Object> values = setPreparedInsertValues2();
+ if (!values.isEmpty() || values != null) {
+ for (Object o : values) {
+ queryobject.addValue(o);
+ }
+ }
+ return queryobject;
+
+ }
+
+ /**
+ * Query Object for Update.
+ *
+ * @return {@link PreparedQueryObject}
+ */
+ public static PreparedQueryObject setPreparedUpdateQueryObject() {
+
+ PreparedQueryObject queryobject = new PreparedQueryObject();
+ queryobject.appendQueryString(updatePreparedQuery);
+ List<Object> values = setPreparedUpdateValues();
+ if (!values.isEmpty() || values != null) {
+ for (Object o : values) {
+ queryobject.addValue(o);
+ }
+ }
+ return queryobject;
+
+ }
+
+ private static ArrayList<String> getAllPossibleLocalIps() {
+ ArrayList<String> allPossibleIps = new ArrayList<String>();
+ try {
+ Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
+ while (en.hasMoreElements()) {
+ NetworkInterface ni = (NetworkInterface) en.nextElement();
+ Enumeration<InetAddress> ee = ni.getInetAddresses();
+ while (ee.hasMoreElements()) {
+ InetAddress ia = (InetAddress) ee.nextElement();
+ allPossibleIps.add(ia.getHostAddress());
+ }
+ }
+ } catch (SocketException e) {
+ System.out.println(e.getMessage());
+ }
+ return allPossibleIps;
+ }
+
+ public static MusicDataStore connectToEmbeddedCassandra() throws Exception {
+ System.setProperty("log4j.configuration", "log4j.properties");
+
+ String address = "localhost";
+
+ EmbeddedCassandraServerHelper.startEmbeddedCassandra();
+ Cluster cluster = new Cluster.Builder().withoutJMXReporting().withoutMetrics().addContactPoint(address).withPort(9142).build();
+ cluster.getConfiguration().getSocketOptions().setReadTimeoutMillis(5000);
+ EnumNameCodec<LockType> lockTypeCodec = new EnumNameCodec<LockType>(LockType.class);
+ cluster.getConfiguration().getCodecRegistry().register(lockTypeCodec);
+
+ Session session = cluster.connect();
+
+ return new MusicDataStore(cluster, session);
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/MusicUtilTest.java b/music-core/src/test/java/org/onap/music/unittests/MusicUtilTest.java
new file mode 100644
index 00000000..39432d07
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/MusicUtilTest.java
@@ -0,0 +1,332 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * Modifications Copyright (C) 2019 IBM.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests;
+
+import static org.junit.Assert.*;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.junit.Test;
+import org.onap.music.datastore.PreparedQueryObject;
+import org.onap.music.main.MusicUtil;
+//import org.onap.music.main.CorePropertiesLoader;
+import org.onap.music.service.MusicCoreService;
+
+import com.datastax.driver.core.ConsistencyLevel;
+import com.datastax.driver.core.DataType;
+
+public class MusicUtilTest {
+
+ private static final String XLATESTVERSION = "X-latestVersion";
+ private static final String XMINORVERSION = "X-minorVersion";
+ private static final String XPATCHVERSION = "X-patchVersion";
+
+ @Test
+ public void testGetCassName() {
+ MusicUtil.setCassName("Cassandra");
+ assertTrue(MusicUtil.getCassName().equals("Cassandra"));
+ }
+
+ @Test
+ public void testGetCassPwd() {
+ MusicUtil.setCassPwd("Cassandra");
+ assertTrue(MusicUtil.getCassPwd().equals("Cassandra"));
+ }
+
+ @Test
+ public void testMusicAafNs() {
+ MusicUtil.setMusicAafNs("ns");
+ assertTrue("ns".equals(MusicUtil.getMusicAafNs()));
+ }
+
+ @Test
+ public void testMusicCoreService() {
+ MusicUtil.setLockUsing(MusicUtil.CASSANDRA);
+ MusicCoreService mc = null;
+ mc = MusicUtil.getMusicCoreService();
+ assertTrue(mc != null);
+ MusicUtil.setLockUsing("nothing");
+ mc = null;
+ mc = MusicUtil.getMusicCoreService();
+ assertTrue(mc != null);
+
+ }
+
+ @Test
+ public void testCipherEncKey() {
+ MusicUtil.setCipherEncKey("cipherEncKey");
+ assertTrue("cipherEncKey".equals(MusicUtil.getCipherEncKey()));
+ }
+
+ @Test
+ public void testGetMusicPropertiesFilePath() {
+ MusicUtil.setMusicPropertiesFilePath("filepath");
+ assertEquals(MusicUtil.getMusicPropertiesFilePath(),"filepath");
+ }
+
+ @Test
+ public void testGetDefaultLockLeasePeriod() {
+ MusicUtil.setDefaultLockLeasePeriod(5000);
+ assertEquals(MusicUtil.getDefaultLockLeasePeriod(),5000);
+ }
+
+ @Test
+ public void testIsDebug() {
+ MusicUtil.setDebug(true);
+ assertTrue(MusicUtil.isDebug());
+ }
+
+ @Test
+ public void testGetVersion() {
+ MusicUtil.setVersion("1.0.0");
+ assertEquals(MusicUtil.getVersion(),"1.0.0");
+ }
+
+ @Test
+ public void testBuildVersionA() {
+ assertEquals(MusicUtil.buildVersion("1","2","3"),"1.2.3");
+ }
+
+ @Test
+ public void testBuildVersionB() {
+ assertEquals(MusicUtil.buildVersion("1",null,"3"),"1");
+ }
+
+ @Test
+ public void testBuildVersionC() {
+ assertEquals(MusicUtil.buildVersion("1","2",null),"1.2");
+ }
+
+/*
+ @Test
+ public void testBuileVersionResponse() {
+ assertTrue(MusicUtil.buildVersionResponse("1","2","3").getClass().getSimpleName().equals("Builder"));
+ assertTrue(MusicUtil.buildVersionResponse("1",null,"3").getClass().getSimpleName().equals("Builder"));
+ assertTrue(MusicUtil.buildVersionResponse("1","2",null).getClass().getSimpleName().equals("Builder"));
+ assertTrue(MusicUtil.buildVersionResponse(null,null,null).getClass().getSimpleName().equals("Builder"));
+ }
+*/
+ @Test
+ public void testGetConsistency() {
+ assertTrue(ConsistencyLevel.ONE.equals(MusicUtil.getConsistencyLevel("one")));
+ }
+
+ @Test
+ public void testRetryCount() {
+ MusicUtil.setRetryCount(1);
+ assertEquals(MusicUtil.getRetryCount(),1);
+ }
+
+ @Test
+ public void testIsCadi() {
+ MusicUtil.setIsCadi(true);
+ assertEquals(MusicUtil.getIsCadi(),true);
+ }
+
+
+ @Test
+ public void testGetMyCassaHost() {
+ MusicUtil.setMyCassaHost("10.0.0.2");
+ assertEquals(MusicUtil.getMyCassaHost(),"10.0.0.2");
+ }
+
+ @Test
+ public void testIsValidQueryObject() {
+ PreparedQueryObject myQueryObject = new PreparedQueryObject();
+ myQueryObject.appendQueryString("select * from apple where type = ?");
+ myQueryObject.addValue("macintosh");
+ assertTrue(MusicUtil.isValidQueryObject(true,myQueryObject));
+
+ myQueryObject.appendQueryString("select * from apple");
+ assertTrue(MusicUtil.isValidQueryObject(false,myQueryObject));
+
+ myQueryObject.appendQueryString("select * from apple where type = ?");
+ assertFalse(MusicUtil.isValidQueryObject(true,myQueryObject));
+
+ myQueryObject = new PreparedQueryObject();
+ myQueryObject.appendQueryString("");
+ System.out.println("#######" + myQueryObject.getQuery().isEmpty());
+ assertFalse(MusicUtil.isValidQueryObject(false,myQueryObject));
+
+
+ }
+
+
+
+
+ @Test(expected = IllegalStateException.class)
+ public void testMusicUtil() {
+ System.out.println("MusicUtil Constructor Test");
+ MusicUtil mu = new MusicUtil();
+ System.out.println(mu.toString());
+ }
+
+ @Test
+ public void testConvertToCQLDataType() throws Exception {
+ Map<String,Object> myMap = new HashMap<String,Object>();
+ myMap.put("name","tom");
+ assertEquals(MusicUtil.convertToCQLDataType(DataType.varchar(),"Happy People"),"'Happy People'");
+ assertEquals(MusicUtil.convertToCQLDataType(DataType.uuid(),UUID.fromString("29dc2afa-c2c0-47ae-afae-e72a645308ab")),"29dc2afa-c2c0-47ae-afae-e72a645308ab");
+ assertEquals(MusicUtil.convertToCQLDataType(DataType.blob(),"Hi"),"Hi");
+ assertEquals(MusicUtil.convertToCQLDataType(DataType.map(DataType.varchar(),DataType.varchar()),myMap),"{'name':'tom'}");
+ }
+
+ @Test
+ public void testConvertToActualDataType() throws Exception {
+ assertEquals(MusicUtil.convertToActualDataType(DataType.varchar(),"Happy People"),"Happy People");
+ assertEquals(MusicUtil.convertToActualDataType(DataType.uuid(),"29dc2afa-c2c0-47ae-afae-e72a645308ab"),UUID.fromString("29dc2afa-c2c0-47ae-afae-e72a645308ab"));
+ assertEquals(MusicUtil.convertToActualDataType(DataType.varint(),"1234"),BigInteger.valueOf(Long.parseLong("1234")));
+ assertEquals(MusicUtil.convertToActualDataType(DataType.bigint(),"123"),Long.parseLong("123"));
+ assertEquals(MusicUtil.convertToActualDataType(DataType.cint(),"123"),Integer.parseInt("123"));
+ assertEquals(MusicUtil.convertToActualDataType(DataType.cfloat(),"123.01"),Float.parseFloat("123.01"));
+ assertEquals(MusicUtil.convertToActualDataType(DataType.cdouble(),"123.02"),Double.parseDouble("123.02"));
+ assertEquals(MusicUtil.convertToActualDataType(DataType.cboolean(),"true"),Boolean.parseBoolean("true"));
+ List<String> myList = new ArrayList<String>();
+ List<String> newList = myList;
+ myList.add("TOM");
+ assertEquals(MusicUtil.convertToActualDataType(DataType.list(DataType.varchar()),myList),newList);
+ Map<String,Object> myMap = new HashMap<String,Object>();
+ myMap.put("name","tom");
+ Map<String,Object> newMap = myMap;
+ assertEquals(MusicUtil.convertToActualDataType(DataType.map(DataType.varchar(),DataType.varchar()),myMap),newMap);
+ }
+
+ @Test
+ public void testConvertToActualDataTypeByte() throws Exception {
+ byte[] testByte = "TOM".getBytes();
+ assertEquals(MusicUtil.convertToActualDataType(DataType.blob(),testByte),ByteBuffer.wrap(testByte));
+
+ }
+
+ @Test
+ public void testJsonMaptoSqlString() throws Exception {
+ Map<String,Object> myMap = new HashMap<>();
+ myMap.put("name","tom");
+ myMap.put("value",5);
+ String result = MusicUtil.jsonMaptoSqlString(myMap,",");
+ assertTrue(result.contains("name"));
+ assertTrue(result.contains("value"));
+ }
+
+ @Test
+ public void test_generateUUID() {
+ //this function shouldn't be in cachingUtil
+ System.out.println("Testing getUUID");
+ String uuid1 = MusicUtil.generateUUID();
+ String uuid2 = MusicUtil.generateUUID();
+ assertFalse(uuid1==uuid2);
+ }
+
+
+ @Test
+ public void testIsValidConsistency(){
+ assertTrue(MusicUtil.isValidConsistency("ALL"));
+ assertFalse(MusicUtil.isValidConsistency("TEST"));
+ }
+
+ @Test
+ public void testLockUsing() {
+ MusicUtil.setLockUsing("testlock");
+ assertEquals("testlock", MusicUtil.getLockUsing());
+ }
+
+ @Test
+ public void testCassaPort() {
+ MusicUtil.setCassandraPort(1234);
+ assertEquals(1234, MusicUtil.getCassandraPort());
+ }
+
+ @Test
+ public void testBuild() {
+ MusicUtil.setBuild("testbuild");
+ assertEquals("testbuild", MusicUtil.getBuild());
+ }
+
+ @Test
+ public void testTransId() {
+ MusicUtil.setTransIdPrefix("prefix");
+ assertEquals("prefix-", MusicUtil.getTransIdPrefix());
+ }
+
+
+ @Test
+ public void testConversationIdPrefix() {
+ MusicUtil.setConversationIdPrefix("prefix-");
+ assertEquals("prefix-", MusicUtil.getConversationIdPrefix());
+ }
+
+ @Test
+ public void testClientIdPrefix() {
+ MusicUtil.setClientIdPrefix("clientIdPrefix");
+ assertEquals("clientIdPrefix-", MusicUtil.getClientIdPrefix());
+ }
+
+ @Test
+ public void testMessageIdPrefix() {
+ MusicUtil.setMessageIdPrefix("clientIdPrefix");
+ assertEquals("clientIdPrefix-", MusicUtil.getMessageIdPrefix());
+ }
+
+ @Test
+ public void testTransIdPrefix() {
+ MusicUtil.setTransIdPrefix("transIdPrefix");
+ assertEquals("transIdPrefix-", MusicUtil.getTransIdPrefix());
+ }
+
+ @Test
+ public void testConvIdReq() {
+ MusicUtil.setConversationIdRequired(true);
+ assertEquals(true, MusicUtil.getConversationIdRequired());
+ }
+
+ @Test
+ public void testClientIdRequired() {
+ MusicUtil.setClientIdRequired(true);
+ assertEquals(true, MusicUtil.getClientIdRequired());
+ }
+
+ @Test
+ public void testMessageIdRequired() {
+ MusicUtil.setMessageIdRequired(true);
+ assertEquals(true, MusicUtil.getMessageIdRequired());
+ }
+
+ @Test
+ public void testTransIdRequired() {
+ MusicUtil.setTransIdRequired(true);
+ assertEquals(true,MusicUtil.getTransIdRequired());
+ }
+/*
+ @Test
+ public void testLoadProperties() {
+ PropertiesLoader pl = new PropertiesLoader();
+ pl.loadProperties();
+ }
+*/
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/ResultTypeTest.java b/music-core/src/test/java/org/onap/music/unittests/ResultTypeTest.java
new file mode 100644
index 00000000..012629e0
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/ResultTypeTest.java
@@ -0,0 +1,43 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.onap.music.main.ResultType;
+
+public class ResultTypeTest {
+
+ @Test
+ public void testResultType() {
+ assertEquals("SUCCESS",ResultType.SUCCESS.name());
+ assertEquals("FAILURE",ResultType.FAILURE.name());
+ }
+
+ @Test
+ public void testGetResult() {
+ assertEquals("Success",ResultType.SUCCESS.getResult());
+ assertEquals("Failure",ResultType.FAILURE.getResult());
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/ReturnTypeTest.java b/music-core/src/test/java/org/onap/music/unittests/ReturnTypeTest.java
new file mode 100644
index 00000000..490020ac
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/ReturnTypeTest.java
@@ -0,0 +1,84 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.music.main.ResultType;
+import org.onap.music.main.ReturnType;
+
+public class ReturnTypeTest {
+
+ @Test
+ public void testReturnType() {
+ ReturnType result = new ReturnType(ResultType.SUCCESS,"message");
+ assertEquals(result.getMessage(),"message");
+ assertEquals(result.getResult(),ResultType.SUCCESS);
+ }
+
+ @Test
+ public void testTimingInfo() {
+ ReturnType result = new ReturnType(ResultType.SUCCESS,"message");
+ result.setTimingInfo("123");
+ assertEquals(result.getTimingInfo(),"123");
+ }
+
+ @Test
+ public void testGetResult() {
+ ReturnType result = new ReturnType(ResultType.FAILURE,"message");
+ assertEquals(result.getResult(),ResultType.FAILURE);
+ }
+
+ @Test
+ public void testGetMessage() {
+ ReturnType result = new ReturnType(ResultType.SUCCESS,"message");
+ result.setMessage("NewMessage");
+ assertEquals(result.getMessage(),"NewMessage");
+ }
+
+ @Test
+ public void testToJson() {
+ ReturnType result = new ReturnType(ResultType.SUCCESS,"message");
+ String myJson = result.toJson();
+ assertTrue(myJson.contains("message"));
+ }
+
+ @Test
+ public void testToString() {
+ ReturnType result = new ReturnType(ResultType.SUCCESS,"message");
+ String test = result.toString();
+ assertTrue(test.contains("message"));
+ }
+
+ @Test
+ public void testToMap() {
+ ReturnType result = new ReturnType(ResultType.SUCCESS,"message");
+ Map<String, Object> myMap = result.toMap();
+ assertTrue(myMap.containsKey("message"));
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java
new file mode 100644
index 00000000..7f6af4c5
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JSONObjectTest.java
@@ -0,0 +1,44 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 IBM.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.onap.music.datastore.jsonobjects.JSONObject;
+
+public class JSONObjectTest {
+ private JSONObject jsonObject;
+
+ @Before
+ public void setUp() {
+ jsonObject = new JSONObject();
+ }
+
+ @Test
+ public void testGetSetData() {
+ jsonObject.setData("data");
+ Assert.assertEquals("data", jsonObject.getData());
+ }
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java
new file mode 100644
index 00000000..a069b81d
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java
@@ -0,0 +1,86 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.music.datastore.jsonobjects.JsonDelete;
+
+public class JsonDeleteTest {
+
+ JsonDelete jd = null;
+
+ @Before
+ public void init() {
+ jd = new JsonDelete();
+ }
+
+ @Test
+ public void testGetConditions() {
+ Map<String,Object> mapSo = new HashMap<>();
+ mapSo.put("key1","one");
+ mapSo.put("key2","two");
+ jd.setConditions(mapSo);
+ assertEquals("one",jd.getConditions().get("key1"));
+ }
+
+ @Test
+ public void testGetConsistencyInfo() {
+ Map<String,String> mapSs = new HashMap<>();
+ mapSs.put("key3","three");
+ mapSs.put("key4","four");
+ jd.setConsistencyInfo(mapSs);
+ assertEquals("three",jd.getConsistencyInfo().get("key3"));
+ }
+
+ @Test
+ public void testGetColumns() {
+ List<String> ary = new ArrayList<>();
+ ary.add("e1");
+ ary.add("e2");
+ ary.add("e3");
+ jd.setColumns(ary);
+ assertEquals("e1",jd.getColumns().get(0));
+ }
+
+ @Test
+ public void testGetTtl() {
+ jd.setTtl("2000");
+ assertEquals("2000",jd.getTtl());
+ }
+
+ @Test
+ public void testGetTimestamp() {
+ jd.setTimestamp("20:00");
+ assertEquals("20:00",jd.getTimestamp());
+
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java
new file mode 100644
index 00000000..4992af7b
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonInsertTest.java
@@ -0,0 +1,111 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Modifications Copyright (c) 2019 IBM.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.junit.Test;
+import org.onap.music.datastore.jsonobjects.JsonInsert;
+
+public class JsonInsertTest {
+
+ JsonInsert ji = new JsonInsert();
+
+ @Test
+ public void testGetKeyspaceName() {
+ ji.setKeyspaceName("keyspace");
+ assertEquals("keyspace",ji.getKeyspaceName());
+ }
+
+ @Test
+ public void testGetTableName() {
+ ji.setTableName("table");
+ assertEquals("table",ji.getTableName());
+ }
+
+ @Test
+ public void testGetConsistencyInfo() {
+ Map<String,String> cons = new HashMap<>();
+ cons.put("test","true");
+ ji.setConsistencyInfo(cons);
+ assertEquals("true",ji.getConsistencyInfo().get("test"));
+ }
+
+ @Test
+ public void testGetTtl() {
+ ji.setTtl("ttl");
+ assertEquals("ttl",ji.getTtl());
+ }
+
+ @Test
+ public void testGetTimestamp() {
+ ji.setTimestamp("10:30");
+ assertEquals("10:30",ji.getTimestamp());
+ }
+
+ @Test
+ public void testGetValues() {
+ Map<String,Object> cons = new HashMap<>();
+ cons.put("val1","one");
+ cons.put("val2","two");
+ ji.setValues(cons);
+ assertEquals("one",ji.getValues().get("val1"));
+ }
+
+ @Test
+ public void testGetRowSpecification() {
+ Map<String,Object> cons = new HashMap<>();
+ cons.put("val1","one");
+ cons.put("val2","two");
+ ji.setRowSpecification(cons);
+ assertEquals("two",ji.getRowSpecification().get("val2"));
+ }
+
+ @Test
+ public void testSerialize() {
+ Map<String,Object> cons = new HashMap<>();
+ cons.put("val1","one");
+ cons.put("val2","two");
+ ji.setTimestamp("10:30");
+ ji.setRowSpecification(cons);
+ byte[] test1 = ji.serialize();
+ byte[] ji1 = SerializationUtils.serialize(ji);
+ assertArrayEquals(ji1,test1);
+ }
+
+ @Test
+ public void testObjectMap()
+ {
+ Map<String, byte[]> map = new HashMap<>();
+ ji.setObjectMap(map);
+ assertEquals(map, ji.getObjectMap());
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java
new file mode 100644
index 00000000..0f4abd7c
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java
@@ -0,0 +1,73 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.*;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.music.datastore.jsonobjects.JsonKeySpace;
+
+public class JsonKeySpaceTest {
+
+ JsonKeySpace jk = null;
+
+
+ @Before
+ public void init() {
+ jk = new JsonKeySpace();
+ }
+
+
+
+ @Test
+ public void testGetConsistencyInfo() {
+ Map<String, String> mapSs = new HashMap<>();
+ mapSs.put("k1", "one");
+ jk.setConsistencyInfo(mapSs);
+ assertEquals("one",jk.getConsistencyInfo().get("k1"));
+ }
+
+ @Test
+ public void testGetReplicationInfo() {
+ Map<String,Object> mapSo = new HashMap<>();
+ mapSo.put("k1", "one");
+ jk.setReplicationInfo(mapSo);
+ assertEquals("one",jk.getReplicationInfo().get("k1"));
+
+ }
+
+ @Test
+ public void testGetDurabilityOfWrites() {
+ jk.setDurabilityOfWrites("1");
+ assertEquals("1",jk.getDurabilityOfWrites());
+ }
+
+ @Test
+ public void testGetKeyspaceName() {
+ jk.setKeyspaceName("Keyspace");
+ assertEquals("Keyspace",jk.getKeyspaceName());
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java
new file mode 100644
index 00000000..b7dfa075
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java
@@ -0,0 +1,47 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.music.datastore.jsonobjects.JsonLeasedLock;
+
+public class JsonLeasedLockTest {
+
+ JsonLeasedLock jl = null;
+
+ @Before
+ public void init() {
+ jl = new JsonLeasedLock();
+ }
+
+
+ @Test
+ public void testGetLeasePeriod() {
+ long lease = 20000;
+ jl.setLeasePeriod(lease);
+ assertEquals(lease,jl.getLeasePeriod());
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java
new file mode 100644
index 00000000..37d1787a
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java
@@ -0,0 +1,56 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Modifications Copyright (c) 2018-2019 IBM
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.music.datastore.jsonobjects.JsonSelect;
+
+public class JsonSelectTest {
+
+ @Test
+ public void testGetConsistencyInfo() {
+ JsonSelect js = new JsonSelect();
+ Map<String, String> mapSs = new HashMap<>();
+ mapSs.put("k1", "one");
+ js.setConsistencyInfo(mapSs);
+ assertEquals("one", js.getConsistencyInfo().get("k1"));
+ }
+
+ @Test
+ public void testSerialize() throws IOException {
+ JsonSelect js = new JsonSelect();
+ Map<String, String> mapSs = new HashMap<>();
+ mapSs.put("Key", "Value");
+ js.setConsistencyInfo(mapSs);
+ js.serialize();
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java
new file mode 100644
index 00000000..4e3b4629
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java
@@ -0,0 +1,100 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Modifications Copyright (c) 2019 IBM.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.*;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.music.datastore.jsonobjects.JsonTable;
+
+public class JsonTableTest {
+
+ JsonTable jt = null;
+
+ @Before
+ public void init() {
+ jt = new JsonTable();
+ }
+
+ @Test
+ public void testGetConsistencyInfo() {
+ Map<String, String> mapSs = new HashMap<>();
+ mapSs.put("k1", "one");
+ jt.setConsistencyInfo(mapSs);
+ assertEquals("one",jt.getConsistencyInfo().get("k1"));
+ }
+
+ @Test
+ public void testGetProperties() {
+ Map<String, Object> properties = new HashMap<>();
+ properties.put("k1", "one");
+ jt.setProperties(properties);
+ }
+
+ @Test
+ public void testGetFields() {
+ Map<String, String> fields = new HashMap<>();
+ fields.put("k1", "one");
+ jt.setFields(fields);
+ assertEquals("one",jt.getFields().get("k1"));
+ }
+
+ @Test
+ public void testGetKeyspaceName() {
+ String keyspace = "keyspace";
+ jt.setKeyspaceName(keyspace);
+ assertEquals(keyspace,jt.getKeyspaceName());
+ }
+
+ @Test
+ public void testGetTableName() {
+ String table = "table";
+ jt.setTableName(table);
+ assertEquals(table,jt.getTableName());
+ }
+
+ @Test
+ public void testGetClusteringOrder() {
+ String clusteringOrder = "clusteringOrder";
+ jt.setClusteringOrder(clusteringOrder);
+ assertEquals(clusteringOrder,jt.getClusteringOrder());
+ }
+
+ @Test
+ public void testGetPrimaryKey() {
+ String primaryKey = "primaryKey";
+ jt.setPrimaryKey(primaryKey);
+ assertEquals(primaryKey,jt.getPrimaryKey());
+ }
+
+ @Test
+ public void testFilteringKey() {
+ jt.setFilteringKey("FilteringKey");
+ assertEquals("FilteringKey",jt.getFilteringKey());
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java
new file mode 100644
index 00000000..e00cb463
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property
+ * ===================================================================
+ * Modifications Copyright (c) 2019 IBM.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ *******************************************************************************/
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.*;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.music.datastore.jsonobjects.JsonUpdate;
+
+public class JsonUpdateTest {
+
+ JsonUpdate ju = null;
+
+ @Before
+ public void init() {
+ ju = new JsonUpdate();
+ }
+
+
+ @Test
+ public void testGetConditions() {
+ Map<String,Object> mapSo = new HashMap<>();
+ mapSo.put("key1","one");
+ mapSo.put("key2","two");
+ ju.setConditions(mapSo);
+ assertEquals("one",ju.getConditions().get("key1"));
+ }
+
+ @Test
+ public void testGetRow_specification() {
+ Map<String,Object> mapSo = new HashMap<>();
+ mapSo.put("key1","one");
+ mapSo.put("key2","two");
+ ju.setRow_specification(mapSo);
+ assertEquals("one",ju.getRow_specification().get("key1"));
+ }
+
+ @Test
+ public void testGetKeyspaceName() {
+ String keyspace = "keyspace";
+ ju.setKeyspaceName(keyspace);
+ assertEquals(keyspace,ju.getKeyspaceName());
+ }
+
+ @Test
+ public void testGetTableName() {
+ String table = "table";
+ ju.setTableName(table);
+ assertEquals(table,ju.getTableName());
+ }
+
+ @Test
+ public void testGetConsistencyInfo() {
+ Map<String, String> mapSs = new HashMap<>();
+ mapSs.put("k1", "one");
+ ju.setConsistencyInfo(mapSs);
+ assertEquals("one",ju.getConsistencyInfo().get("k1"));
+ }
+
+ @Test
+ public void testGetTtl() {
+ ju.setTtl("2000");
+ assertEquals("2000",ju.getTtl());
+ }
+
+ @Test
+ public void testGetTimestamp() {
+ ju.setTimestamp("20:00");
+ assertEquals("20:00",ju.getTimestamp());
+
+ }
+
+ @Test
+ public void testGetValues() {
+ Map<String,Object> cons = new HashMap<>();
+ cons.put("val1","one");
+ cons.put("val2","two");
+ ju.setValues(cons);
+ assertEquals("one",ju.getValues().get("val1"));
+ }
+
+ @Test
+ public void testSerialize() {
+ assertTrue(ju.serialize() instanceof byte[]);
+ }
+
+}
diff --git a/music-core/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java
new file mode 100644
index 00000000..ceda3f3a
--- /dev/null
+++ b/music-core/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java
@@ -0,0 +1,48 @@
+/*
+ * ============LICENSE_START==========================================
+ * org.onap.music
+ * ===================================================================
+ * Copyright (c) 2019 IBM.
+ * ===================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=============================================
+ * ====================================================================
+ */
+
+package org.onap.music.unittests.jsonobjects;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.music.eelf.healthcheck.MusicHealthCheck;
+
+public class MusicHealthCheckTest {
+
+ private MusicHealthCheck musicHealthCheck;
+
+ @Before
+ public void setUp()
+ {
+ musicHealthCheck= new MusicHealthCheck();
+ }
+
+ @Test
+ public void testCassandraHost()
+ {
+ musicHealthCheck.setCassandrHost("9042");
+ assertEquals("9042", musicHealthCheck.getCassandrHost());
+ }
+
+}
diff --git a/music-core/src/test/resources/LICENSE.txt b/music-core/src/test/resources/LICENSE.txt
new file mode 100644
index 00000000..cc6cdea5
--- /dev/null
+++ b/music-core/src/test/resources/LICENSE.txt
@@ -0,0 +1,24 @@
+
+The following license applies to all files in this and sub-directories. Licenses
+are included in individual source files where appropriate, and if it differs
+from this text, it supersedes this. Any file that does not have license text
+defaults to being covered by this text; not all files support the addition of
+licenses.
+#
+# -------------------------------------------------------------------------
+# Copyright (c) 2017 AT&T Intellectual Property
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# -------------------------------------------------------------------------
+# \ No newline at end of file
diff --git a/music-core/src/test/resources/Resources.properties b/music-core/src/test/resources/Resources.properties
new file mode 100644
index 00000000..72269cb8
--- /dev/null
+++ b/music-core/src/test/resources/Resources.properties
@@ -0,0 +1,50 @@
+#============LICENSE_START==========================================
+#org.onap.music
+#===================================================================
+# Copyright (c) 2017 AT&T Intellectual Property
+#===================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#============LICENSE_END=============================================
+#====================================================================
+#Resource key=Error Code|Message text|Resolution text |Description text
+LOADING_DEFAULT_LOG_CONFIGURATION=\
+ EELF0001I|\
+ Loading default logging configuration from system resource file "{0}"|\
+ No external logging configurations were defined or found, So verify the default logging configuration from system resource file (../logback.xml). |\
+ Loading default logging configuration from system resource file
+LOADING_LOG_CONFIGURATION=EELF0002I|\
+ Loading logging configuration from file "{0}"|\
+ Verify the correct logging configuration file is loaded. |\
+ Loading logging configuration for specific file
+LOGGING_ALREADY_INITIALIZED=\
+ EELF0003W|\
+ Logging has already been initialized, check the container logging definitions to ensure they represent your desired logging configuration.|\
+ Verify the container logging definitions to ensure they represent your desired logging configuration. |\
+ Logging has already been initialized, check the container logging definitions to ensure they represent your desired logging configuration.
+NO_LOG_CONFIGURATION=\
+ EELF0004E|\
+ No log configuration could be found or defaulted!|\
+ No external and default logging configuration file. |\
+ No log configuration could be found or defaulted!
+SEARCHING_LOG_CONFIGURATION=\
+ EELF0005I|\
+ Searching path "{0}" for log configuration file "{1}"|\
+ Verify the correct Path({user.home};etc;../etc) and filename (eelf.logging.file).|\
+ Searching path for specific log configuration file.
+UNSUPPORTED_LOGGING_FRAMEWORK=\
+ EELF0006E|\
+ An unsupported logging framework is bound to SLF4J. |\
+ Verify your logging frameworks.|\
+ An unsupported logging framework is bound to SLF4J.
+
diff --git a/music-core/src/test/resources/application.properties b/music-core/src/test/resources/application.properties
new file mode 100644
index 00000000..02e9c1a9
--- /dev/null
+++ b/music-core/src/test/resources/application.properties
@@ -0,0 +1,2 @@
+server.port=8080
+server.servlet.context-path=/MUSIC/rest \ No newline at end of file
diff --git a/music-core/src/test/resources/cache.ccf b/music-core/src/test/resources/cache.ccf
new file mode 100644
index 00000000..e152ee8b
--- /dev/null
+++ b/music-core/src/test/resources/cache.ccf
@@ -0,0 +1,62 @@
+# DEFAULT CACHE REGION
+jcs.default=DC
+jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.default.cacheattributes.MaxObjects=1000
+jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.default.elementattributes.IsEternal=true
+jcs.default.elementattributes.IsSpool=true
+
+# PRE-DEFINED CACHE REGIONS
+jcs.region.musicCache=
+jcs.region.musicCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.region.musicCache.cacheattributes.MaxObjects=1000
+jcs.region.musicCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.region.musicCache.cacheattributes.UseMemoryShrinker=false
+jcs.region.musicCache.cacheattributes.MaxMemoryIdleTime=3600
+jcs.region.musicCache.cacheattributes.ShrinkerInterval=60
+jcs.region.musicCache.cacheattributes.MaxSpoolPerRun=500
+jcs.region.musicCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.region.musicCache.elementattributes.IsEternal=false
+
+
+# PRE-DEFINED CACHE REGIONS
+jcs.region.aafCache=
+jcs.region.aafCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.region.aafCache.cacheattributes.MaxObjects=1000
+jcs.region.aafCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.region.aafCache.cacheattributes.UseMemoryShrinker=false
+jcs.region.aafCache.cacheattributes.MaxMemoryIdleTime=3600
+jcs.region.aafCache.cacheattributes.ShrinkerInterval=60
+jcs.region.aafCache.cacheattributes.MaxSpoolPerRun=500
+jcs.region.aafCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.region.aafCache.elementattributes.IsEternal=false
+
+# PRE-DEFINED CACHE REGIONS
+jcs.region.appNameCache=
+jcs.region.appNameCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.region.appNameCache.cacheattributes.MaxObjects=1000
+jcs.region.appNameCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.region.appNameCache.cacheattributes.UseMemoryShrinker=false
+jcs.region.appNameCache.cacheattributes.MaxMemoryIdleTime=3600
+jcs.region.appNameCache.cacheattributes.ShrinkerInterval=60
+jcs.region.appNameCache.cacheattributes.MaxSpoolPerRun=500
+jcs.region.appNameCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.region.appNameCache.elementattributes.IsEternal=false
+
+jcs.default=DC
+jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.default.cacheattributes.MaxObjects=1000
+jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.default.elementattributes.IsEternal=true
+jcs.default.elementattributes.IsSpool=true
+
+jcs.region.eternalCache=DC
+jcs.region.eternalCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.region.eternalCache.cacheattributes.MaxObjects=1000
+jcs.region.eternalCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.region.eternalCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.region.eternalCache.elementattributes.IsEternal=true
+jcs.region.eternalCache.elementattributes.IsSpool=true
+
diff --git a/music-core/src/test/resources/logback.xml b/music-core/src/test/resources/logback.xml
new file mode 100644
index 00000000..6bc5fd5e
--- /dev/null
+++ b/music-core/src/test/resources/logback.xml
@@ -0,0 +1,302 @@
+<!--
+ ============LICENSE_START==========================================
+ org.onap.music
+ ===================================================================
+ Copyright (c) 2017 AT&T Intellectual Property
+ ===================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ ============LICENSE_END=============================================
+ ====================================================================
+-->
+<configuration scan="true" scanPeriod="3 seconds">
+ <!--<jmxConfigurator /> -->
+ <!-- directory path for all other type logs -->
+ <property name="logDir" value="/opt/app/music/logs" />
+
+ <!-- directory path for debugging type logs -->
+ <property name="debugDir" value="debug-logs" />
+
+ <!-- specify the component name -->
+ <!-- <property name="componentName" value="EELF"></property> -->
+ <property name="componentName" value="MUSIC"></property>
+
+ <!-- log file names -->
+ <property name="generalLogName" value="music" />
+ <property name="securityLogName" value="security" />
+ <property name="errorLogName" value="error" />
+ <property name="metricsLogName" value="metrics" />
+ <property name="auditLogName" value="audit" />
+ <property name="debugLogName" value="debug" />
+ <property name="defaultPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n" />
+ <!-- <property name="applicationLoggerPattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %msg%n" /> -->
+ <property name="applicationLoggerPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5level %X{keyspace} - %msg%n" />
+ <property name="auditLoggerPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Unused}|%X{ProcessKey}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}| %msg%n" />
+ <property name="metricsLoggerPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Unused}|%X{ProcessKey}|%X{TargetVirtualEntity}|%X{CustomField1}|%X{CustomField2}|%X{CustomField3}|%X{CustomField4}| %msg%n" />
+ <!-- <property name="errorLoggerPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %msg%n " /> -->
+ <property name="errorLoggerPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5level %X{keyspace} - %msg%n" />
+ <property name="debugLoggerPattern" value="%date{ISO8601,UTC}|%X{RequestId}| %msg%n" ></property>
+ <property name="logDirectory" value="${logDir}/${componentName}" />
+ <property name="debugLogDirectory" value="${debugDir}/${componentName}" />
+ <!-- Example evaluator filter applied against console appender -->
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- <encoder>
+ <pattern>${defaultPattern}</pattern>
+ </encoder> -->
+ <layout class="">
+ <pattern>
+ %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
+ </pattern>
+ </layout>
+ </appender>
+
+ <!-- ============================================================================ -->
+ <!-- EELF Appenders -->
+ <!-- ============================================================================ -->
+<!-- <appender name="EELF"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>100MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${applicationLoggerPattern}</pattern>
+ </encoder>
+ </appender> -->
+
+ <!-- <appender name="EELF" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ daily rollover
+ <fileNamePattern>${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>1GB</maxFileSize>
+ <maxHistory>5</maxHistory>
+ <totalSizeCap>5GB</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${applicationLoggerPattern}</pattern>
+ </encoder>
+ </appender> -->
+
+
+ <appender name="EELF" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <!-- daily rollover -->
+ <fileNamePattern>${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>1GB</maxFileSize>
+ <maxHistory>5</maxHistory>
+ <totalSizeCap>5GB</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${applicationLoggerPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <includeCallerData>true</includeCallerData>
+ <appender-ref ref="EELF" />
+ </appender>
+
+ <!-- EELF Security Appender. This appender is used to record security events
+ to the security log file. Security events are separate from other loggers
+ in EELF so that security log records can be captured and managed in a secure
+ way separate from the other logs. This appender is set to never discard any
+ events. -->
+ <appender name="EELFSecurity"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${securityLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${securityLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n </pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFSecurity" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <discardingThreshold>0</discardingThreshold>
+ <appender-ref ref="EELFSecurity" />
+ </appender>
+
+
+
+
+ <!-- EELF Audit Appender. This appender is used to record audit engine
+ related logging events. The audit logger and appender are specializations
+ of the EELF application root logger and appender. This can be used to segregate
+ Policy engine events from other components, or it can be eliminated to record
+ these events as part of the application root log. -->
+
+ <appender name="EELFAudit"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${auditLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${auditLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${auditLoggerPattern}</pattern>
+ </encoder>
+ </appender>
+ <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFAudit" />
+ </appender>
+
+<appender name="EELFMetrics"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${metricsLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${metricsLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <!-- <pattern>"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} -
+ %msg%n"</pattern> -->
+ <pattern>${metricsLoggerPattern}</pattern>
+ </encoder>
+ </appender>
+
+
+ <appender name="asyncEELFMetrics" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFMetrics"/>
+ </appender>
+
+ <appender name="EELFError"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${errorLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${errorLoggerPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFError"/>
+ </appender>
+
+ <appender name="EELFDebug"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${debugLogDirectory}/${debugLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <fileNamePattern>${debugLogDirectory}/${debugLogName}.%i.log.zip
+ </fileNamePattern>
+ <minIndex>1</minIndex>
+ <maxIndex>9</maxIndex>
+ </rollingPolicy>
+ <triggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <maxFileSize>5MB</maxFileSize>
+ </triggeringPolicy>
+ <encoder>
+ <pattern>${debugLoggerPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFDebug" />
+ <includeCallerData>true</includeCallerData>
+ </appender>
+
+
+ <!-- ============================================================================ -->
+ <!-- EELF loggers -->
+ <!-- ============================================================================ -->
+ <logger name="com.att.eelf" level="info" additivity="false">
+ <appender-ref ref="asyncEELF" />
+
+ </logger>
+ <logger name="com.att.eelf.security" level="info" additivity="false">
+ <appender-ref ref="asyncEELFSecurity" />
+
+ </logger>
+
+
+ <logger name="com.att.eelf.audit" level="info" additivity="false">
+ <appender-ref ref="asyncEELFAudit" />
+
+ </logger>
+
+ <logger name="com.att.eelf.metrics" level="info" additivity="false">
+ <appender-ref ref="asyncEELFMetrics" />
+
+ </logger>
+
+
+ <logger name="com.att.eelf.error" level="error" additivity="false">
+ <appender-ref ref="asyncEELFError" />
+
+ </logger>
+
+ <logger name="com.att.eelf.debug" level="debug" additivity="false">
+ <appender-ref ref="asyncEELFDebug" />
+
+ </logger>
+
+ <root level="INFO">
+ <appender-ref ref="asyncEELF" />
+ <!-- <appender-ref ref="STDOUT" /> -->
+ </root>
+
+ <!-- Conductor Specific additions to squash WARNING and INFO -->
+ <logger name="com.datastax.driver.core.Cluster" level="ERROR"/>
+ <logger name="org.onap.music.main.MusicCore" level="ERROR"/>
+
+</configuration>
diff --git a/music-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/music-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
new file mode 100644
index 00000000..1f0955d4
--- /dev/null
+++ b/music-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
@@ -0,0 +1 @@
+mock-maker-inline
diff --git a/music-core/src/test/resources/mockito-extensions/org.mockito.plugins.StackTraceCleanerProvider b/music-core/src/test/resources/mockito-extensions/org.mockito.plugins.StackTraceCleanerProvider
new file mode 100644
index 00000000..bc2f0992
--- /dev/null
+++ b/music-core/src/test/resources/mockito-extensions/org.mockito.plugins.StackTraceCleanerProvider
@@ -0,0 +1 @@
+org.mockito.internal.exceptions.stacktrace.DefaultStackTraceCleanerProvider
diff --git a/music-core/src/test/resources/project.properties b/music-core/src/test/resources/project.properties
new file mode 100644
index 00000000..199afa33
--- /dev/null
+++ b/music-core/src/test/resources/project.properties
@@ -0,0 +1,4 @@
+version=${project.version}
+artifactId=${project.artifactId}
+music.properties=/opt/app/music/etc/music.properties
+