aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/sdnr/src
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2024-06-13 09:24:00 +0100
committerwaynedunican <wayne.dunican@est.tech>2024-06-24 16:30:48 +0100
commit7b11ab5c03a438aa29ff2242fa06bb8ff28c2867 (patch)
tree2c76324c1d60b761f09b82fb1786e4633510dbb9 /models-interactions/model-impl/sdnr/src
parentbacd5a6f57e79f26d447644329b585991f989123 (diff)
Convert models to JUnit 5
Review for models-impl Issue-ID: POLICY-5042 Change-Id: I22ff90b12da3fb2ba4d0eead7afb9282eac6921f Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'models-interactions/model-impl/sdnr/src')
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java14
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java14
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java14
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseCodeTest.java12
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java26
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java14
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java14
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java14
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java18
-rw-r--r--models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/util/SerializationTest.java10
10 files changed, 75 insertions, 75 deletions
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java
index 11f408aeb..1885ed124 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciCommonHeaderTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,24 +22,24 @@
package org.onap.policy.sdnr;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.function.BiConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciCommonHeaderTest {
+class PciCommonHeaderTest {
private static final String KANSAS = "Kansas";
private static final String CAN_I_GO_HOME = "Can I go home?";
@Test
- public void testPciCommonHeader() {
+ void testPciCommonHeader() {
PciCommonHeader commonHeader = new PciCommonHeader();
assertNotNull(commonHeader);
assertNotNull(new PciCommonHeader(commonHeader));
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java
index d504dbb7b..1334fcc42 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,18 +22,18 @@
package org.onap.policy.sdnr;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciRequestTest {
+class PciRequestTest {
private static final String MODIFY = "Modify";
@Test
- public void testPciRequest() {
+ void testPciRequest() {
PciRequest request = new PciRequest();
assertNotNull(request);
assertNotEquals(0, request.hashCode());
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java
index e44800e4b..722c081d4 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciRequestWrapperTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,16 +23,16 @@
package org.onap.policy.sdnr;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciRequestWrapperTest {
+class PciRequestWrapperTest {
@Test
- public void testPciRequestWrapperWrapper() {
+ void testPciRequestWrapperWrapper() {
assertNotNull(new PciRequestWrapper(new PciRequest()));
PciRequestWrapper requestWrapper = new PciRequestWrapper();
assertNotNull(requestWrapper);
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseCodeTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseCodeTest.java
index 7f102759e..6cfd7a30f 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseCodeTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseCodeTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,15 +21,15 @@
package org.onap.policy.sdnr;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciResponseCodeTest {
+class PciResponseCodeTest {
@Test
- public void testPciResponseCode() {
+ void testPciResponseCode() {
assertNull(PciResponseCode.toResponseValue(0));
assertEquals(PciResponseCode.ACCEPTED, PciResponseCode.toResponseValue(100));
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java
index bd96e8e4c..70480b1f7 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,15 +22,15 @@
package org.onap.policy.sdnr;
-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.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciResponseTest {
+class PciResponseTest {
Status status = new Status(0, "");
@@ -39,7 +39,7 @@ public class PciResponseTest {
@Test
- public void testHashCode() {
+ void testHashCode() {
PciResponse response = new PciResponse();
assertNotEquals(0, response.hashCode());
response.setCommonHeader(new PciCommonHeader());
@@ -51,7 +51,7 @@ public class PciResponseTest {
}
@Test
- public void testPciResponse() {
+ void testPciResponse() {
PciResponse response = new PciResponse();
assertNull(response.getCommonHeader());
assertNull(response.getPayload());
@@ -59,13 +59,13 @@ public class PciResponseTest {
}
@Test
- public void testToString() {
+ void testToString() {
PciResponse response = new PciResponse();
assertFalse(response.toString().isEmpty());
}
@Test
- public void testEqualsObject() {
+ void testEqualsObject() {
PciResponse response = new PciResponse();
assertEquals(response, response);
assertNotEquals(response, null);
@@ -107,7 +107,7 @@ public class PciResponseTest {
}
@Test
- public void testResponseRequest() {
+ void testResponseRequest() {
PciRequest request = new PciRequest();
request.setCommonHeader(new PciCommonHeader());
request.setPayload(requestPayload);
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java
index eab065500..1b0247336 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciResponseWrapperTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,16 +22,16 @@
package org.onap.policy.sdnr;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciResponseWrapperTest {
+class PciResponseWrapperTest {
@Test
- public void testPciResponseWrapperWrapper() {
+ void testPciResponseWrapperWrapper() {
PciResponseWrapper responseWrapper = new PciResponseWrapper();
assertNotNull(responseWrapper);
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java
index f0b6ffb90..e8f779edb 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciStatusTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,18 +22,18 @@
package org.onap.policy.sdnr;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciStatusTest {
+class PciStatusTest {
private static final String THE_WONDERFUL_LAND_OF_OZ = "The wonderful land of Oz";
@Test
- public void testResponseStatus() {
+ void testResponseStatus() {
Status status = new Status();
assertNotNull(status);
assertNotEquals(0, status.hashCode());
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java
index 708363bcc..8e915c3e9 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/PciWrapperTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,14 +22,14 @@
package org.onap.policy.sdnr;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.function.BiConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class PciWrapperTest {
+class PciWrapperTest {
private static final String YELLOW_BRICK_ROAD = "YellowBrickRoad";
private static final String TORNADO = "Tornado";
@@ -38,7 +38,7 @@ public class PciWrapperTest {
private static final String VERSION_19 = "19.3.9";
@Test
- public void testPciWrapper() {
+ void testPciWrapper() {
PciWrapper wrapper = new PciWrapper();
assertNotNull(wrapper);
assertNotEquals(0, wrapper.hashCode());
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java
index c84084890..3fd2cfd5b 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java
@@ -22,17 +22,17 @@
package org.onap.policy.sdnr;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.UUID;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.onap.policy.sdnr.util.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class SdnrTest {
+class SdnrTest {
private static final String CORRELATION_ID = "664be3d2-6c12-4f4b-a3e7-c349acced200";
@@ -81,7 +81,7 @@ public class SdnrTest {
}
@Test
- public void testRequestSerialization() {
+ void testRequestSerialization() {
/*
* Use the gson serializer to obtain json
@@ -110,7 +110,7 @@ public class SdnrTest {
}
@Test
- public void testRequestDeserialization() {
+ void testRequestDeserialization() {
/*
* Convert the PCI request object into json so we have a string of json to use for testing
@@ -151,7 +151,7 @@ public class SdnrTest {
}
@Test
- public void testResponseSerialization() {
+ void testResponseSerialization() {
/*
* Use the serializer to convert the object into json
@@ -176,7 +176,7 @@ public class SdnrTest {
}
@Test
- public void testResponseDeserialization() {
+ void testResponseDeserialization() {
/*
* Convert the PCI response object into json so we have a string of json to use for testing
*/
diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/util/SerializationTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/util/SerializationTest.java
index ca2ca0544..0e733a609 100644
--- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/util/SerializationTest.java
+++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/util/SerializationTest.java
@@ -3,7 +3,7 @@
* sdnr
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,17 +21,17 @@
package org.onap.policy.sdnr.util;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class SerializationTest {
+class SerializationTest {
@Test
- public void test() {
+ void test() {
String nameString = "Dorothy";
String jsonName = Serialization.gsonPretty.toJson(nameString, String.class);
assertEquals("\"Dorothy\"", jsonName);