aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap/music/unittests/jsonobjects
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/onap/music/unittests/jsonobjects')
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java1
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java1
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java1
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonNotificationTest.java116
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonOnboardTest.java1
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java1
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java8
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java8
-rw-r--r--src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java (renamed from src/test/java/org/onap/music/unittests/jsonobjects/JsonNotifyClientResponseTest.java)42
9 files changed, 46 insertions, 133 deletions
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java
index 885694bd..4c5af38f 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonDeleteTest.java
@@ -19,6 +19,7 @@
* ============LICENSE_END=============================================
* ====================================================================
*/
+
package org.onap.music.unittests.jsonobjects;
import static org.junit.Assert.*;
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java
index 882d5d5e..0f4abd7c 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonKeySpaceTest.java
@@ -19,6 +19,7 @@
* ============LICENSE_END=============================================
* ====================================================================
*/
+
package org.onap.music.unittests.jsonobjects;
import static org.junit.Assert.*;
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java
index 63f901c6..0014093d 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonLeasedLockTest.java
@@ -19,6 +19,7 @@
* ============LICENSE_END=============================================
* ====================================================================
*/
+
package org.onap.music.unittests.jsonobjects;
import static org.junit.Assert.*;
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonNotificationTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonNotificationTest.java
deleted file mode 100644
index e5b13ca8..00000000
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonNotificationTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * ============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 java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.music.datastore.jsonobjects.JsonNotification;
-
-public class JsonNotificationTest {
-
- private JsonNotification jsonNotification;
-
- @Before
- public void setUp()
- {
- jsonNotification= new JsonNotification();
- }
-
- @Test
- public void testGetSetNotify_field()
- {
- jsonNotification.setNotify_field("notify_field");
- assertEquals("notify_field", jsonNotification.getNotify_field());
- }
-
- @Test
- public void testGetSetEndpoint()
- {
- jsonNotification.setEndpoint("endpoint");
- assertEquals("endpoint", jsonNotification.getEndpoint());
- }
-
- @Test
- public void testGetSetUsername()
- {
- jsonNotification.setUsername("Username");
- assertEquals("Username", jsonNotification.getUsername());
- }
-
- @Test
- public void testGetSetPassword()
- {
- jsonNotification.setPassword("Password");
- assertEquals("Password", jsonNotification.getPassword());
- }
-
- @Test
- public void testGetSetResponse_body()
- {
- Map<String, String> ResponseBody= new HashMap<>();
- jsonNotification.setResponse_body(ResponseBody);
- assertEquals(ResponseBody, jsonNotification.getResponse_body());
- }
-
- @Test
- public void testGetSetNotify_change()
- {
- jsonNotification.setNotify_change("Notify_change");
- assertEquals("Notify_change", jsonNotification.getNotify_change());
- }
-
- @Test
- public void testGetSetNotify_insert()
- {
- jsonNotification.setNotify_insert("Notify_insert");
- assertEquals("Notify_insert", jsonNotification.getNotify_insert());
- }
-
- @Test
- public void testGetSetNotify_delete()
- {
- jsonNotification.setNotify_delete("Notify_delete");
- assertEquals("Notify_delete", jsonNotification.getNotify_delete());
- }
-
- @Test
- public void testGetSetOperation_type()
- {
- jsonNotification.setOperation_type("Operation_type");
- assertEquals("Operation_type", jsonNotification.getOperation_type());
- }
-
- @Test
- public void testGetSetTriggerName()
- {
- jsonNotification.setTriggerName("TriggerName");
- assertEquals("TriggerName", jsonNotification.getTriggerName());
- }
-
-
-}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonOnboardTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonOnboardTest.java
index 82f1748a..1e66ed58 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonOnboardTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonOnboardTest.java
@@ -19,6 +19,7 @@
* ============LICENSE_END=============================================
* ====================================================================
*/
+
package org.onap.music.unittests.jsonobjects;
import static org.junit.Assert.*;
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java
index f776e546..37d1787a 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonSelectTest.java
@@ -21,6 +21,7 @@
* ============LICENSE_END=============================================
* ====================================================================
*/
+
package org.onap.music.unittests.jsonobjects;
import static org.junit.Assert.assertEquals;
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java
index e4c800fc..2279cf0b 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonTableTest.java
@@ -4,6 +4,8 @@
* ===================================================================
* 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
@@ -95,5 +97,11 @@ public class JsonTableTest {
jt.setPrimaryKey(primaryKey);
assertEquals(primaryKey,jt.getPrimaryKey());
}
+
+ @Test
+ public void testFilteringKey() {
+ jt.setFilteringKey("FilteringKey");
+ assertEquals("FilteringKey",jt.getFilteringKey());
+ }
}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java
index 54db0540..e00cb463 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/JsonUpdateTest.java
@@ -4,6 +4,8 @@
* ===================================================================
* 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
@@ -19,6 +21,7 @@
* ============LICENSE_END=============================================
* ====================================================================
*******************************************************************************/
+
package org.onap.music.unittests.jsonobjects;
import static org.junit.Assert.*;
@@ -99,5 +102,10 @@ public class JsonUpdateTest {
ju.setValues(cons);
assertEquals("one",ju.getValues().get("val1"));
}
+
+ @Test
+ public void testSerialize() {
+ assertTrue(ju.serialize() instanceof byte[]);
+ }
}
diff --git a/src/test/java/org/onap/music/unittests/jsonobjects/JsonNotifyClientResponseTest.java b/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java
index 07f4dbb4..f48ecd40 100644
--- a/src/test/java/org/onap/music/unittests/jsonobjects/JsonNotifyClientResponseTest.java
+++ b/src/test/java/org/onap/music/unittests/jsonobjects/MusicHealthCheckTest.java
@@ -2,45 +2,53 @@
* ============LICENSE_START==========================================
* org.onap.music
* ===================================================================
- * Copyright (c) 2018 IBM.
+ * 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 org.junit.Assert;
+import static org.junit.Assert.assertEquals;
+
import org.junit.Before;
import org.junit.Test;
+import org.onap.music.eelf.healthcheck.MusicHealthCheck;
-import org.onap.music.datastore.jsonobjects.JsonNotifyClientResponse;
-
-public class JsonNotifyClientResponseTest {
- private JsonNotifyClientResponse response;
+public class MusicHealthCheckTest {
+ private MusicHealthCheck musicHealthCheck;
+
@Before
- public void setUp() {
- response = new JsonNotifyClientResponse();
+ public void setUp()
+ {
+ musicHealthCheck= new MusicHealthCheck();
}
-
+
+ @Test
+ public void testCassandraHost()
+ {
+ musicHealthCheck.setCassandrHost("9042");
+ assertEquals("9042", musicHealthCheck.getCassandrHost());
+ }
+
@Test
- public void testGetSetMethods() {
- response.setMessage("message");
- response.setStatus("success");
- Assert.assertEquals("message", response.getMessage());
- Assert.assertEquals("success", response.getStatus());
+ public void testZookeeperHost()
+ {
+ musicHealthCheck.setZookeeperHost("ZookeeperHost");
+ assertEquals("ZookeeperHost", musicHealthCheck.getZookeeperHost());
}
}