aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-02-13 10:53:12 -0500
committerJim Hahn <jrh3@att.com>2019-02-13 12:29:39 -0500
commitc064f5e9ea7e385ae8c730bb9e9fc5fdd45e25d6 (patch)
treeddf1281d011e5e110085c0c0535c5cde741bcd78 /policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java
parenteaaf4f237ad0dce620b5385ce8c7424dd01d2c26 (diff)
Add gson handler and tests
Added JacksonHandler which provides jackson behavior in gson. Also added classes to facilitate testing of gson serializations. Added compareGson(xxx, Class). Removed trailing spaces from some files. Updated license dates. Replaced incorrect constant with ${xxx} in json test file. Fixed typo in test method name. Change-Id: If05b654d76a4ffc88646f03334be82b32506f28f Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java
index 76883b3c..a8ea84fc 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP Policy Engine - Common Modules
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* 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.
@@ -37,6 +37,7 @@ import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.event.comm.TopicListener;
import org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase;
+import org.onap.policy.common.utils.gson.GsonTestUtils;
public class TopicBaseTest extends TopicTestBase {
@@ -48,7 +49,7 @@ public class TopicBaseTest extends TopicTestBase {
@Before
public void setUp() {
super.setUp();
-
+
base = new TopicBaseImpl(servers, MY_TOPIC);
}
@@ -73,6 +74,11 @@ public class TopicBaseTest extends TopicTestBase {
}
@Test
+ public void testSerialize() {
+ new GsonTestUtils().compareGson(base, TopicBaseTest.class);
+ }
+
+ @Test
public void testRegister() {
TopicListener listener = mock(TopicListener.class);
base.register(listener);
@@ -246,7 +252,7 @@ public class TopicBaseTest extends TopicTestBase {
/**
* Constructor.
- *
+ *
* @param servers list of servers
* @param topic topic name
*/
@@ -285,7 +291,7 @@ public class TopicBaseTest extends TopicTestBase {
/**
* Adds an event to the list of recent events.
- *
+ *
* @param event event to be added
*/
public void addEvent(String event) {