aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/appc/src/test/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-05-08 14:33:57 -0400
committerJim Hahn <jrh3@att.com>2019-05-08 16:24:35 -0400
commit10b21aae2bde224ab7f91f4b5ab1b89369c8fd1c (patch)
tree0417099e379e8be69f90221e8fd066fc40def62b /controlloop/common/model-impl/appc/src/test/java
parent01841878936986bc80a974977ccdeaceaf7f9a78 (diff)
Add payload to vFW policy yaml
Added new "streams" payload to vFW policy yaml files. Removed references to pg-streams. Also deleted directories that were moved to policy/models. Also removed references to trafficgenerator. Updated licenses. Removed some trailing whitespace. Change-Id: I6becaa573628eee677f0959fadf86f9a9f032f88 Issue-ID: POLICY-1752 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/model-impl/appc/src/test/java')
-rw-r--r--controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java178
-rw-r--r--controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java74
-rw-r--r--controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java124
-rw-r--r--controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java88
-rw-r--r--controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java104
-rw-r--r--controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java56
6 files changed, 0 insertions, 624 deletions
diff --git a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java b/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java
deleted file mode 100644
index 93a05f424..000000000
--- a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.time.Instant;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.junit.Test;
-
-public class CommonHeaderTest {
-
- @Test
- public void testCommonHeader() {
- CommonHeader commonHeader = new CommonHeader();
- assertNotNull(commonHeader);
- assertNotNull(new CommonHeader(commonHeader));
- assertNotEquals(0, commonHeader.hashCode());
-
- commonHeader.setApiVer("Kansas");
- assertEquals("Kansas", commonHeader.getApiVer());
-
- List<Map<String, String>> flagSet = new ArrayList<>();
- commonHeader.setFlags(flagSet);
- assertEquals(flagSet, commonHeader.getFlags());
-
- commonHeader.setOriginatorId("Dorothy");
- assertEquals("Dorothy", commonHeader.getOriginatorId());
-
- UUID requestId = UUID.randomUUID();
- commonHeader.setRequestId(requestId);
- assertEquals(requestId, commonHeader.getRequestId());
-
- List<String> requestTrackSet = new ArrayList<>();
- commonHeader.setRequestTrack(requestTrackSet);
- assertEquals(requestTrackSet, commonHeader.getRequestTrack());
-
- commonHeader.setSubRequestId("Can I go home?");
- assertEquals("Can I go home?", commonHeader.getSubRequestId());
-
- Instant timestamp = Instant.now();
- commonHeader.setTimeStamp(timestamp);
- assertEquals(timestamp, commonHeader.getTimeStamp());
-
- assertNotEquals(0, commonHeader.hashCode());
-
- assertEquals("CommonHeader [TimeStamp=", commonHeader.toString().substring(0, 24));
-
- CommonHeader copiedCommonHeader = new CommonHeader();
- copiedCommonHeader.setApiVer(commonHeader.getApiVer());
- copiedCommonHeader.setFlags(commonHeader.getFlags());
- copiedCommonHeader.setOriginatorId(commonHeader.getOriginatorId());
- copiedCommonHeader.setRequestId(commonHeader.getRequestId());
- copiedCommonHeader.setRequestTrack(commonHeader.getRequestTrack());
- copiedCommonHeader.setSubRequestId(commonHeader.getSubRequestId());
- copiedCommonHeader.setTimeStamp(commonHeader.getTimeStamp());
-
- assertTrue(commonHeader.equals(commonHeader));
- assertTrue(commonHeader.equals(copiedCommonHeader));
- assertFalse(commonHeader.equals(null));
- assertFalse(commonHeader.equals("Hello"));
-
- CommonHeader clonedCommonHeader = new CommonHeader(commonHeader);
- clonedCommonHeader.setApiVer(commonHeader.getApiVer());
- clonedCommonHeader.setTimeStamp(commonHeader.getTimeStamp());
-
- assertTrue(commonHeader.equals(clonedCommonHeader));
-
- commonHeader.setApiVer(null);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setApiVer(null);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- commonHeader.setApiVer("Kansas");
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setApiVer("Kansas");
- assertTrue(commonHeader.equals(copiedCommonHeader));
-
- commonHeader.setFlags(null);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setFlags(null);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- commonHeader.setFlags(flagSet);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setFlags(flagSet);
- assertTrue(commonHeader.equals(copiedCommonHeader));
-
- commonHeader.setOriginatorId(null);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setOriginatorId(null);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- commonHeader.setOriginatorId("Dorothy");
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setOriginatorId("Dorothy");
- assertTrue(commonHeader.equals(copiedCommonHeader));
-
- commonHeader.setRequestId(null);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setRequestId(null);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- commonHeader.setRequestId(requestId);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setRequestId(requestId);
- assertTrue(commonHeader.equals(copiedCommonHeader));
-
- commonHeader.setRequestTrack(null);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setRequestTrack(null);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- commonHeader.setRequestTrack(requestTrackSet);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setRequestTrack(requestTrackSet);
- assertTrue(commonHeader.equals(copiedCommonHeader));
-
- commonHeader.setSubRequestId(null);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setSubRequestId(null);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- commonHeader.setSubRequestId("Can I go home?");
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setSubRequestId("Can I go home?");
- assertTrue(commonHeader.equals(copiedCommonHeader));
-
- commonHeader.setTimeStamp(null);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setTimeStamp(null);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- commonHeader.setTimeStamp(timestamp);
- assertFalse(commonHeader.equals(copiedCommonHeader));
- copiedCommonHeader.setTimeStamp(timestamp);
- assertTrue(commonHeader.equals(copiedCommonHeader));
- }
-}
diff --git a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java b/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java
deleted file mode 100644
index afb9a312e..000000000
--- a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Test;
-
-public class EnumsTest {
-
- @Test
- public void testResponseCode() {
- assertEquals(5, ResponseCode.values().length);
-
- assertNull(ResponseCode.toResponseCode(0));
-
- assertEquals(ResponseCode.ACCEPT, ResponseCode.toResponseCode(100));
- assertEquals(ResponseCode.ERROR, ResponseCode.toResponseCode(200));
- assertEquals(ResponseCode.REJECT, ResponseCode.toResponseCode(300));
- assertEquals(ResponseCode.SUCCESS, ResponseCode.toResponseCode(400));
- assertEquals(ResponseCode.FAILURE, ResponseCode.toResponseCode(500));
-
- assertEquals(100, ResponseCode.ACCEPT.getValue());
- assertEquals(200, ResponseCode.ERROR.getValue());
- assertEquals(300, ResponseCode.REJECT.getValue());
- assertEquals(400, ResponseCode.SUCCESS.getValue());
- assertEquals(500, ResponseCode.FAILURE.getValue());
-
- assertEquals("100", ResponseCode.ACCEPT.toString());
- assertEquals("200", ResponseCode.ERROR.toString());
- assertEquals("300", ResponseCode.REJECT.toString());
- assertEquals("400", ResponseCode.SUCCESS.toString());
- assertEquals("500", ResponseCode.FAILURE.toString());
- }
-
- @Test
- public void testResponseValue() {
- assertEquals(5, ResponseValue.values().length);
-
- assertNull(ResponseValue.toResponseValue("Dorothy"));
- assertNull(ResponseValue.toResponseValue(null));
-
- assertEquals(ResponseValue.ACCEPT, ResponseValue.toResponseValue("ACCEPT"));
- assertEquals(ResponseValue.ERROR, ResponseValue.toResponseValue("ERROR"));
- assertEquals(ResponseValue.REJECT, ResponseValue.toResponseValue("REJECT"));
- assertEquals(ResponseValue.SUCCESS, ResponseValue.toResponseValue("SUCCESS"));
- assertEquals(ResponseValue.FAILURE, ResponseValue.toResponseValue("FAILURE"));
-
- assertEquals("ACCEPT", ResponseValue.ACCEPT.toString());
- assertEquals("ERROR", ResponseValue.ERROR.toString());
- assertEquals("REJECT", ResponseValue.REJECT.toString());
- assertEquals("SUCCESS", ResponseValue.SUCCESS.toString());
- assertEquals("FAILURE", ResponseValue.FAILURE.toString());
- }
-}
diff --git a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java b/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java
deleted file mode 100644
index e0c850b60..000000000
--- a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-
-public class RequestTest {
-
- @Test
- public void testRequest() {
- Request request = new Request();
- assertNotNull(request);
- assertNotEquals(0, request.hashCode());
-
- CommonHeader commonHeader = new CommonHeader();
-
- request.setCommonHeader(commonHeader);
- assertEquals(commonHeader, request.getCommonHeader());
-
- request.setAction("Go to Oz");
- assertEquals("Go to Oz", request.getAction());
-
- request.setObjectId("Wizard");
- assertEquals("Wizard", request.getObjectId());
-
- request.setTargetId("Oz");
- assertEquals("Oz", request.getTargetId());
-
- Map<String, Object> payload = new HashMap<>();
- payload.put("North", "Good Witch");
- payload.put("West", "Bad Witch");
-
- request.setPayload(payload);
- assertEquals(payload, request.getPayload());
-
- assertNotEquals(0, request.hashCode());
-
- assertEquals("Request [CommonHeader=CommonHeader [TimeStamp=", request.toString().substring(0, 46));
-
- Request copiedRequest = new Request();
- copiedRequest.setCommonHeader(request.getCommonHeader());
- copiedRequest.setAction(request.getAction());
- copiedRequest.setObjectId(request.getObjectId());
- copiedRequest.setPayload(request.getPayload());
- copiedRequest.setTargetId(request.getTargetId());
-
- assertTrue(request.equals(request));
- assertTrue(request.equals(copiedRequest));
- assertFalse(request.equals(null));
- assertFalse(request.equals("Hello"));
-
- request.setCommonHeader(null);
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setCommonHeader(null);
- assertTrue(request.equals(copiedRequest));
- request.setCommonHeader(commonHeader);
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setCommonHeader(commonHeader);
- assertTrue(request.equals(copiedRequest));
-
- request.setAction(null);
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setAction(null);
- assertTrue(request.equals(copiedRequest));
- request.setAction("Go to Oz");
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setAction("Go to Oz");
- assertTrue(request.equals(copiedRequest));
-
- request.setObjectId(null);
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setObjectId(null);
- assertTrue(request.equals(copiedRequest));
- request.setObjectId("Wizard");
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setObjectId("Wizard");
- assertTrue(request.equals(copiedRequest));
-
- request.setTargetId(null);
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setTargetId(null);
- assertTrue(request.equals(copiedRequest));
- request.setTargetId("Oz");
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setTargetId("Oz");
- assertTrue(request.equals(copiedRequest));
-
- request.setPayload(new HashMap<String, Object>());
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setPayload(new HashMap<String, Object>());
- assertTrue(request.equals(copiedRequest));
- request.setPayload(payload);
- assertFalse(request.equals(copiedRequest));
- copiedRequest.setPayload(payload);
- assertTrue(request.equals(copiedRequest));
- }
-}
diff --git a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java b/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java
deleted file mode 100644
index ab8811d37..000000000
--- a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class ResponseStatusTest {
-
- @Test
- public void testResonseStatus() {
- ResponseStatus status = new ResponseStatus();
- assertNotNull(status);
- assertNotEquals(0, status.hashCode());
-
- status.setCode(1234);
- assertEquals(1234, status.getCode());
-
- status.setDescription("The wonderful land of Oz");
- assertEquals("The wonderful land of Oz", status.getDescription());
-
- status.setValue("There's no place like home");
- assertEquals("There's no place like home", status.getValue());
- assertNotEquals(0, status.hashCode());
-
- assertEquals("ResponseStatus [Code=1234, Value=There's no pla", status.toString().substring(0, 47));
-
- ResponseStatus copiedStatus = new ResponseStatus();
- copiedStatus.setCode(status.getCode());
- copiedStatus.setDescription(status.getDescription());
- copiedStatus.setValue(status.getValue());
-
- assertTrue(status.equals(status));
- assertTrue(status.equals(copiedStatus));
- assertFalse(status.equals(null));
- assertFalse(status.equals("Hello"));
-
- status.setCode(-1);
- assertFalse(status.equals(copiedStatus));
- copiedStatus.setCode(-1);
- assertTrue(status.equals(copiedStatus));
- status.setCode(1234);
- assertFalse(status.equals(copiedStatus));
- copiedStatus.setCode(1234);
- assertTrue(status.equals(copiedStatus));
-
- status.setDescription(null);
- assertFalse(status.equals(copiedStatus));
- copiedStatus.setDescription(null);
- assertTrue(status.equals(copiedStatus));
- status.setDescription("The wonderful land of Oz");
- assertFalse(status.equals(copiedStatus));
- copiedStatus.setDescription("The wonderful land of Oz");
- assertTrue(status.equals(copiedStatus));
-
- status.setValue(null);
- assertFalse(status.equals(copiedStatus));
- copiedStatus.setValue(null);
- assertTrue(status.equals(copiedStatus));
- status.setValue("There's no place like home");
- assertFalse(status.equals(copiedStatus));
- copiedStatus.setValue("There's no place like home");
- assertTrue(status.equals(copiedStatus));
- }
-}
diff --git a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java b/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java
deleted file mode 100644
index ce0ba90a5..000000000
--- a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-
-public class ResponseTest {
-
- @Test
- public void testResonse() {
- Response response = new Response();
- assertNotNull(response);
- assertNotNull(new Response(new Request()));
- assertNotEquals(0, response.hashCode());
-
- CommonHeader commonHeader = new CommonHeader();
-
- Request request = new Request();
- request.setCommonHeader(commonHeader);
- assertNotNull(new Response(request));
-
- response.setCommonHeader(commonHeader);
- assertEquals(commonHeader, response.getCommonHeader());
-
- ResponseStatus status = new ResponseStatus();
- response.setStatus(status);
- assertEquals(status, response.getStatus());
-
- Map<String, Object> payload = new HashMap<>();
- payload.put("North", "Good Witch");
- payload.put("West", "Bad Witch");
-
- response.setPayload(payload);
- assertEquals(payload, response.getPayload());
-
- assertNotEquals(0, response.hashCode());
-
- assertEquals("Response [CommonHeader=CommonHeader [TimeStamp=", response.toString().substring(0, 47));
-
- Response copiedResponse = new Response();
- copiedResponse.setCommonHeader(response.getCommonHeader());
- copiedResponse.setStatus(response.getStatus());
- copiedResponse.setPayload(response.getPayload());
-
- assertTrue(response.equals(response));
- assertTrue(response.equals(copiedResponse));
- assertFalse(response.equals(null));
- assertFalse(response.equals("Hello"));
-
- response.setCommonHeader(null);
- assertFalse(response.equals(copiedResponse));
- copiedResponse.setCommonHeader(null);
- assertTrue(response.equals(copiedResponse));
- response.setCommonHeader(commonHeader);
- assertFalse(response.equals(copiedResponse));
- copiedResponse.setCommonHeader(commonHeader);
- assertTrue(response.equals(copiedResponse));
-
- response.setStatus(null);
- assertFalse(response.equals(copiedResponse));
- copiedResponse.setStatus(null);
- assertTrue(response.equals(copiedResponse));
- response.setStatus(status);
- assertFalse(response.equals(copiedResponse));
- copiedResponse.setStatus(status);
- assertTrue(response.equals(copiedResponse));
-
- response.setPayload(new HashMap<String, Object>());
- assertFalse(response.equals(copiedResponse));
- copiedResponse.setPayload(new HashMap<String, Object>());
- assertTrue(response.equals(copiedResponse));
- response.setPayload(payload);
- assertFalse(response.equals(copiedResponse));
- copiedResponse.setPayload(payload);
- assertTrue(response.equals(copiedResponse));
- }
-}
diff --git a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java b/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java
deleted file mode 100644
index 6a3a3a099..000000000
--- a/controlloop/common/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * appc
- * ================================================================================
- * Copyright (C) 2017-2018 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.appc.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.time.Instant;
-import java.time.ZoneId;
-import java.time.ZonedDateTime;
-
-import org.junit.Test;
-
-public class SerializationTest {
-
- @Test
- public void test() {
- String nameString = "Dorothy";
- String jsonName = Serialization.gsonPretty.toJson(nameString, String.class);
- assertEquals("\"Dorothy\"", jsonName);
- String jsonInOutName = Serialization.gsonPretty.fromJson(jsonName, String.class);
- assertEquals("Dorothy", jsonInOutName);
-
- Instant instant = Instant.ofEpochMilli(1516127215000L);
- String instantString = Serialization.gsonPretty.toJson(instant, Instant.class);
- assertEquals("1516127215000", instantString);
- Instant outInstant = Serialization.gsonPretty.fromJson(instantString, Instant.class);
- assertEquals(instant, outInstant);
-
- ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, ZoneId.of("UTC"));
- String zdtString = Serialization.gsonPretty.toJson(zdt, ZonedDateTime.class);
- assertEquals("\"2018-01-16 18:26:55.000000+00:00\"", zdtString);
- ZonedDateTime outZdt = Serialization.gsonPretty.fromJson(zdtString, ZonedDateTime.class);
- assertEquals(zdt.getDayOfWeek(), outZdt.getDayOfWeek());
-
- assertNull(Serialization.gsonPretty.fromJson("oz time is weird", ZonedDateTime.class));
- }
-}