From 7b11ab5c03a438aa29ff2242fa06bb8ff28c2867 Mon Sep 17 00:00:00 2001 From: waynedunican Date: Thu, 13 Jun 2024 09:24:00 +0100 Subject: Convert models to JUnit 5 Review for models-impl Issue-ID: POLICY-5042 Change-Id: I22ff90b12da3fb2ba4d0eead7afb9282eac6921f Signed-off-by: waynedunican --- .../test/java/org/onap/policy/appc/CommonHeaderTest.java | 14 +++++++------- .../appc/src/test/java/org/onap/policy/appc/EnumsTest.java | 14 +++++++------- .../src/test/java/org/onap/policy/appc/RequestTest.java | 14 +++++++------- .../test/java/org/onap/policy/appc/ResponseStatusTest.java | 14 +++++++------- .../src/test/java/org/onap/policy/appc/ResponseTest.java | 14 +++++++------- .../java/org/onap/policy/appc/util/SerializationTest.java | 10 +++++----- 6 files changed, 40 insertions(+), 40 deletions(-) (limited to 'models-interactions/model-impl/appc') diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java index 8c00fd5de..72a78147b 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java @@ -3,7 +3,7 @@ * appc * ================================================================================ * Copyright (C) 2017-2021 AT&T 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. @@ -22,9 +22,9 @@ package org.onap.policy.appc; 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 java.time.Instant; import java.util.ArrayList; @@ -32,16 +32,16 @@ import java.util.List; 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 CommonHeaderTest { +class CommonHeaderTest { private static final String KANSAS = "Kansas"; private static final String DOROTHY = "Dorothy"; private static final String CAN_I_GO_HOME = "Can I go home?"; @Test - public void testCommonHeader() { + void testCommonHeader() { CommonHeader commonHeader = new CommonHeader(); assertNotNull(commonHeader); assertNotNull(new CommonHeader(commonHeader)); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java index bc4429f02..998612426 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/EnumsTest.java @@ -3,7 +3,7 @@ * appc * ================================================================================ * Copyright (C) 2017-2019 AT&T 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.appc; -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 EnumsTest { +class EnumsTest { @Test - public void testResponseCode() { + void testResponseCode() { assertEquals(5, ResponseCode.values().length); assertNull(ResponseCode.toResponseCode(0)); @@ -54,7 +54,7 @@ public class EnumsTest { } @Test - public void testResponseValue() { + void testResponseValue() { assertEquals(5, ResponseValue.values().length); assertNull(ResponseValue.toResponseValue("Dorothy")); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java index 52b974c54..7ab4ae746 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java @@ -3,7 +3,7 @@ * appc * ================================================================================ * Copyright (C) 2017-2021 AT&T 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. @@ -22,22 +22,22 @@ package org.onap.policy.appc; 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 java.util.HashMap; import java.util.Map; import java.util.function.BiConsumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RequestTest { +class RequestTest { private static final String WIZARD = "Wizard"; private static final String GO_TO_OZ = "Go to Oz"; @Test - public void testRequest() { + void testRequest() { Request request = new Request(); assertNotNull(request); assertNotEquals(0, request.hashCode()); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java index cd4e2a697..a13e08f64 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java @@ -3,7 +3,7 @@ * appc * ================================================================================ * Copyright (C) 2017-2021 AT&T 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. @@ -22,19 +22,19 @@ package org.onap.policy.appc; 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 ResponseStatusTest { +class ResponseStatusTest { private static final String THERE_S_NO_PLACE_LIKE_HOME = "There's no place like home"; private static final String THE_WONDERFUL_LAND_OF_OZ = "The wonderful land of Oz"; @Test - public void testResonseStatus() { + void testResponseStatus() { ResponseStatus status = new ResponseStatus(); assertNotNull(status); assertNotEquals(0, status.hashCode()); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java index 42e5a6d85..ee0ff371b 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java @@ -3,7 +3,7 @@ * appc * ================================================================================ * Copyright (C) 2017-2021 AT&T 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. @@ -22,18 +22,18 @@ package org.onap.policy.appc; 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 java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ResponseTest { +class ResponseTest { @Test - public void testResonse() { + void testResonse() { Response response = new Response(); assertNotNull(response); assertNotNull(new Response(new Request())); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java index 93c3c9e04..0bf35bc9c 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/util/SerializationTest.java @@ -3,7 +3,7 @@ * appc * ================================================================================ * Copyright (C) 2017-2019, 2021 AT&T 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. @@ -22,18 +22,18 @@ package org.onap.policy.appc.util; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.gson.JsonParseException; 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); -- cgit