diff options
author | waynedunican <wayne.dunican@est.tech> | 2024-06-13 09:24:00 +0100 |
---|---|---|
committer | waynedunican <wayne.dunican@est.tech> | 2024-06-24 16:30:48 +0100 |
commit | 7b11ab5c03a438aa29ff2242fa06bb8ff28c2867 (patch) | |
tree | 2c76324c1d60b761f09b82fb1786e4633510dbb9 | |
parent | bacd5a6f57e79f26d447644329b585991f989123 (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>
81 files changed, 639 insertions, 600 deletions
diff --git a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiCqResponseTest.java b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiCqResponseTest.java index bc832edb6..c7910b118 100644 --- a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiCqResponseTest.java +++ b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiCqResponseTest.java @@ -3,6 +3,7 @@ * * ================================================================================ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,10 +21,10 @@ package org.onap.policy.aai; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -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.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.io.File; import java.nio.charset.StandardCharsets; @@ -31,7 +32,7 @@ import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.aai.domain.yang.CloudRegion; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.ModelVer; @@ -42,7 +43,7 @@ import org.onap.aai.domain.yang.Vserver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class AaiCqResponseTest { +class AaiCqResponseTest { private static final String ETE_VFMODULE = "Vfmodule_Ete_vFWCLvFWSNK_7ba1fbde_0"; private static final String ETE_VNF = "Ete_vFWCLvFWSNK_7ba1fbde_0"; private static final Logger LOGGER = LoggerFactory.getLogger(AaiCqResponseTest.class); @@ -50,7 +51,7 @@ public class AaiCqResponseTest { "src/test/resources/org/onap/policy/aai/AaiCqResponseFull.json"; @Test - public void testConstructor() throws Exception { + void testConstructor() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -60,7 +61,7 @@ public class AaiCqResponseTest { } @Test - public void testMultiThreaded() throws Exception { + void testMultiThreaded() throws Exception { final AtomicInteger success = new AtomicInteger(0); final String json = getAaiCqResponse(); @@ -81,7 +82,7 @@ public class AaiCqResponseTest { } @Test - public void testAaiMalformedCqResponse() throws Exception { + void testAaiMalformedCqResponse() throws Exception { String responseString = Files.readString( new File("src/test/resources/org/onap/policy/aai/AaiMalformedCqResponse.json").toPath(), StandardCharsets.UTF_8); @@ -95,7 +96,7 @@ public class AaiCqResponseTest { } @Test - public void testGetItemByList() throws Exception { + void testGetItemByList() throws Exception { /* * Read JSON String and add all AaiObjects */ @@ -113,7 +114,7 @@ public class AaiCqResponseTest { } @Test - public void testGetServiceInstance() throws Exception { + void testGetServiceInstance() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -126,7 +127,7 @@ public class AaiCqResponseTest { } @Test - public void testGetDefaultCloudRegion() throws Exception { + void testGetDefaultCloudRegion() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -138,7 +139,7 @@ public class AaiCqResponseTest { } @Test - public void testGetDefaultTenant() throws Exception { + void testGetDefaultTenant() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -150,7 +151,7 @@ public class AaiCqResponseTest { } @Test - public void testGetGenericVnfs() throws Exception { + void testGetGenericVnfs() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -164,7 +165,7 @@ public class AaiCqResponseTest { } @Test - public void testGetDefaultGenericVnf() throws Exception { + void testGetDefaultGenericVnf() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -177,7 +178,7 @@ public class AaiCqResponseTest { } @Test - public void testGetGenericVnfByName() throws Exception { + void testGetGenericVnfByName() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -189,7 +190,7 @@ public class AaiCqResponseTest { } @Test - public void testGetGenericVnfByModelInvariantId() throws Exception { + void testGetGenericVnfByModelInvariantId() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -202,7 +203,7 @@ public class AaiCqResponseTest { } @Test - public void testGetGenericVnfByVfModuleModelInvariantId() throws Exception { + void testGetGenericVnfByVfModuleModelInvariantId() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -215,7 +216,7 @@ public class AaiCqResponseTest { } @Test - public void testGetAllVfModules() throws Exception { + void testGetAllVfModules() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -229,7 +230,7 @@ public class AaiCqResponseTest { } @Test - public void testGetVfModuleByVfModuleName() throws Exception { + void testGetVfModuleByVfModuleName() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -242,7 +243,7 @@ public class AaiCqResponseTest { } @Test - public void testGetVfModuleByVfModelInvariantId() throws Exception { + void testGetVfModuleByVfModelInvariantId() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -256,7 +257,7 @@ public class AaiCqResponseTest { } @Test - public void testGetDefaultVfModule() throws Exception { + void testGetDefaultVfModule() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -268,7 +269,7 @@ public class AaiCqResponseTest { } @Test - public void testGetVserver() throws Exception { + void testGetVserver() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -281,7 +282,7 @@ public class AaiCqResponseTest { } @Test - public void testGetAllModelVer() throws Exception { + void testGetAllModelVer() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -295,7 +296,7 @@ public class AaiCqResponseTest { } @Test - public void testGetModelVerByVersionId() throws Exception { + void testGetModelVerByVersionId() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse; @@ -309,7 +310,7 @@ public class AaiCqResponseTest { } @Test - public void testGetVfModuleCount() throws Exception { + void testGetVfModuleCount() throws Exception { String responseString = getAaiCqResponse(); AaiCqResponse aaiCqResponse = new AaiCqResponse(responseString); int count = aaiCqResponse.getVfModuleCount("47958575-138f-452a-8c8d-d89b595f8164", diff --git a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java index 9b20fe92a..1d8253c6f 100644 --- a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java +++ b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java @@ -3,7 +3,7 @@ * aai * ================================================================================ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019-2020 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,9 +21,9 @@ package org.onap.policy.aai; -import static org.junit.Assert.assertEquals; -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.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.ArgumentMatchers.anyMap; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.contains; @@ -38,11 +38,11 @@ import java.nio.file.Files; import java.util.Map; import java.util.UUID; import org.apache.commons.lang3.tuple.Pair; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.onap.policy.rest.RestManager; -public class AaiManagerTest { +class AaiManagerTest { private static final String CQ_QUERY_URL = "http://testing.cq.query"; private static final String DOROTHY = "Dorothy"; private static final String SOME_URL = "http://somewhere.over.the.rainbow"; @@ -60,8 +60,8 @@ public class AaiManagerTest { * * @throws Exception if error occurs */ - @Before - public void beforeTestAaiManager() throws Exception { + @BeforeEach + void beforeTestAaiManager() throws Exception { restManagerMock = mock(RestManager.class); String aaiCqResponse = new AaiCqResponseTest().getAaiCqResponse(); @@ -75,7 +75,7 @@ public class AaiManagerTest { @Test - public void testAaiCqResponse() { + void testAaiCqResponse() { AaiManager aaiManager = new AaiManager(restManagerMock); assertNotNull(aaiManager); @@ -115,7 +115,7 @@ public class AaiManagerTest { @Test - public void testAaiManagerGetPnf() { + void testAaiManagerGetPnf() { AaiManager aaiManager = new AaiManager(restManagerMock); assertNotNull(aaiManager); String pnfName = "test-pnf"; 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); diff --git a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmCommonHeaderTest.java b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmCommonHeaderTest.java index 1c71c85b8..785de692c 100644 --- a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmCommonHeaderTest.java +++ b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmCommonHeaderTest.java @@ -3,7 +3,7 @@ * appclcm * ================================================================================ * 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.appclcm; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AppcLcmCommonHeaderTest { +class AppcLcmCommonHeaderTest { @Test - public void testAppcLcmCommonHeaderConstructor() { + void testAppcLcmCommonHeaderConstructor() { AppcLcmCommonHeader commonHeader = new AppcLcmCommonHeader("Policy", UUID.randomUUID(), "1"); AppcLcmCommonHeader commonHeaderCopy = new AppcLcmCommonHeader(commonHeader); assertEquals(commonHeader, commonHeaderCopy); diff --git a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmModelsTest.java b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmModelsTest.java index d1a02ea9e..61d73b7df 100644 --- a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmModelsTest.java +++ b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmModelsTest.java @@ -3,6 +3,7 @@ * appclcm * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -26,14 +27,14 @@ import com.openpojo.validation.Validator; import com.openpojo.validation.ValidatorBuilder; import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.policy.common.utils.test.ToStringTester; -public class AppcLcmModelsTest { +class AppcLcmModelsTest { private static final String POJO_PACKAGE = "org.onap.policy.appclcm"; @Test - public void testAppcLcmModels() { + void testAppcLcmModels() { final Validator validator = ValidatorBuilder.create().with(new ToStringTester()).with(new SetterTester()) .with(new GetterTester()).build(); diff --git a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmOutputTest.java b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmOutputTest.java index 1490416cd..31d6bca01 100644 --- a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmOutputTest.java +++ b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmOutputTest.java @@ -3,7 +3,7 @@ * appclcm * ================================================================================ * 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,18 +21,18 @@ package org.onap.policy.appclcm; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.util.HashMap; import java.util.Map; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AppcLcmOutputTest { +class AppcLcmOutputTest { @Test - public void testAppcLcmOutput() { + void testAppcLcmOutput() { AppcLcmCommonHeader commonHeader = new AppcLcmCommonHeader("Policy", UUID.randomUUID(), "1"); Map<String, String> actionIdentifiers = new HashMap<>(); AppcLcmInput input = new AppcLcmInput(commonHeader, "testAction", actionIdentifiers, "testPayload"); diff --git a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmResponseCodeTest.java b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmResponseCodeTest.java index 4cadd1e63..300b05e18 100644 --- a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmResponseCodeTest.java +++ b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/AppcLcmResponseCodeTest.java @@ -3,6 +3,7 @@ * appclcm * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,15 +21,15 @@ package org.onap.policy.appclcm; -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 AppcLcmResponseCodeTest { +class AppcLcmResponseCodeTest { @Test - public void testAppcLcmResponseCode() { + void testAppcLcmResponseCode() { assertNull(AppcLcmResponseCode.toResponseValue(0)); assertEquals(AppcLcmResponseCode.ACCEPTED, AppcLcmResponseCode.toResponseValue(100)); diff --git a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/util/SerializationTest.java b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/util/SerializationTest.java index 52c2c54bd..543570226 100644 --- a/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/util/SerializationTest.java +++ b/models-interactions/model-impl/appclcm/src/test/java/org/onap/policy/appclcm/util/SerializationTest.java @@ -3,7 +3,7 @@ * appclcm * ================================================================================ * 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,17 +21,17 @@ package org.onap.policy.appclcm.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); diff --git a/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/BasicAuthClientHeaderInterceptorTest.java b/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/BasicAuthClientHeaderInterceptorTest.java index 3192520ae..83107aef8 100644 --- a/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/BasicAuthClientHeaderInterceptorTest.java +++ b/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/BasicAuthClientHeaderInterceptorTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2019 Bell Canada. * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -19,7 +20,7 @@ package org.onap.policy.cds.client; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.AdditionalAnswers.delegatesTo; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -40,9 +41,8 @@ import io.grpc.testing.GrpcCleanupRule; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Base64; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.ArgumentMatchers; import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc; @@ -51,15 +51,14 @@ import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessin import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.onap.policy.cds.properties.CdsServerProperties; -public class BasicAuthClientHeaderInterceptorTest { +class BasicAuthClientHeaderInterceptorTest { // Generate a unique in-process server name. private static final String SERVER_NAME = InProcessServerBuilder.generateName(); private static final String CREDS = "test"; // Manages automatic graceful shutdown for the registered server and client channels at the end of test. - @Rule - public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + private final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); private final ServerInterceptor mockCdsGrpcServerInterceptor = mock(ServerInterceptor.class, delegatesTo(new TestServerInterceptor())); @@ -73,8 +72,8 @@ public class BasicAuthClientHeaderInterceptorTest { * * @throws IOException on failure to register the test grpc server for graceful shutdown */ - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { // Setup the CDS properties props.setHost(SERVER_NAME); props.setPort(2000); @@ -95,7 +94,7 @@ public class BasicAuthClientHeaderInterceptorTest { } @Test - public void testIfBasicAuthHeaderIsDeliveredToCdsServer() { + void testIfBasicAuthHeaderIsDeliveredToCdsServer() { BluePrintProcessingServiceStub bpProcessingSvcStub = BluePrintProcessingServiceGrpc .newStub(ClientInterceptors.intercept(channel, new BasicAuthClientHeaderInterceptor(props))); ArgumentCaptor<Metadata> metadataCaptor = ArgumentCaptor.forClass(Metadata.class); @@ -129,10 +128,9 @@ public class BasicAuthClientHeaderInterceptorTest { @Override public <Q, P> Listener<Q> interceptCall(final ServerCall<Q, P> serverCall, - final Metadata metadata, final ServerCallHandler<Q, P> serverCallHandler) { + final Metadata metadata, final ServerCallHandler<Q, P> + serverCallHandler) { return serverCallHandler.startCall(serverCall, metadata); } } } - - diff --git a/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/CdsProcessorGrpcClientTest.java b/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/CdsProcessorGrpcClientTest.java index 0922fc4cb..1a35064ca 100644 --- a/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/CdsProcessorGrpcClientTest.java +++ b/models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/CdsProcessorGrpcClientTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2019 Bell Canada. * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,8 +21,9 @@ package org.onap.policy.cds.client; import static org.assertj.core.api.Assertions.assertThatCode; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; @@ -30,7 +32,6 @@ import io.grpc.ManagedChannel; import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.StreamObserver; -import io.grpc.testing.GrpcCleanupRule; import io.grpc.util.MutableHandlerRegistry; import java.io.IOException; import java.util.ArrayList; @@ -39,10 +40,9 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers; import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; @@ -51,22 +51,16 @@ import org.onap.policy.cds.api.CdsProcessorListener; import org.onap.policy.cds.api.TestCdsProcessorListenerImpl; import org.onap.policy.cds.properties.CdsServerProperties; -public class CdsProcessorGrpcClientTest { +class CdsProcessorGrpcClientTest { - // Generate a unique in-process server name. - private static final String SERVER_NAME = InProcessServerBuilder.generateName(); - - // Manages automatic graceful shutdown for the registered server and client channels at the end of test. - @Rule - public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); - - private final CdsProcessorListener listener = spy(new TestCdsProcessorListenerImpl()); - private final CdsServerProperties props = new CdsServerProperties(); - private final MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry(); - private final AtomicReference<StreamObserver<ExecutionServiceOutput>> responseObserverRef = new AtomicReference<>(); - private final List<String> messagesDelivered = new ArrayList<>(); - private final CountDownLatch allRequestsDelivered = new CountDownLatch(1); + private CdsProcessorListener listener; + private CdsServerProperties props; + private MutableHandlerRegistry serviceRegistry; + private AtomicReference<StreamObserver<ExecutionServiceOutput>> responseObserverRef; + private List<String> messagesDelivered; + private CountDownLatch allRequestsDelivered; + private ManagedChannel channel; private CdsProcessorGrpcClient client; /** @@ -74,22 +68,31 @@ public class CdsProcessorGrpcClientTest { * * @throws IOException on failure to register the test grpc server for graceful shutdown */ - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { + + listener = spy(new TestCdsProcessorListenerImpl()); + props = new CdsServerProperties(); + serviceRegistry = new MutableHandlerRegistry(); + responseObserverRef = new AtomicReference<>(); + messagesDelivered = new ArrayList<>(); + allRequestsDelivered = new CountDownLatch(1); + // Setup the CDS properties - props.setHost(SERVER_NAME); + // Generate a unique in-process server name. + String serverName = InProcessServerBuilder.generateName(); + props.setHost(serverName); props.setPort(2000); props.setUsername("testUser"); props.setPassword("testPassword"); props.setTimeout(60); // Create a server, add service, start, and register for automatic graceful shutdown. - grpcCleanup.register(InProcessServerBuilder.forName(SERVER_NAME) - .fallbackHandlerRegistry(serviceRegistry).directExecutor().build().start()); + InProcessServerBuilder.forName(serverName) + .fallbackHandlerRegistry(serviceRegistry).directExecutor().build().start(); - // Create a client channel and register for automatic graceful shutdown - ManagedChannel channel = grpcCleanup - .register(InProcessChannelBuilder.forName(SERVER_NAME).directExecutor().build()); + // Create a client channel + channel = InProcessChannelBuilder.forName(serverName).directExecutor().build(); // Create an instance of the gRPC client client = new CdsProcessorGrpcClient(channel, new CdsProcessorHandler(listener, "gRPC://localhost:1234/")); @@ -122,24 +125,40 @@ public class CdsProcessorGrpcClientTest { serviceRegistry.addService(testCdsBlueprintServerImpl); } - @After - public void tearDown() { - client.close(); + /** + * Cleans up resources after each test execution. + * This method ensures that the gRPC client and channel are properly closed and released after each test. + * It is annotated with {@code @AfterEach} to automatically run after each test method in the class. + * If the {@code client} is not {@code null}, it calls the {@code close} method to release resources + * used by the client. + * If the {@code channel} is not {@code null}, it calls the {@code shutdownNow} method + * to forcefully close the channel. + */ + @AfterEach + void tearDown() { + if (client != null) { + client.close(); + } + if (channel != null) { + channel.shutdownNow(); + } } @Test - public void testCdsProcessorGrpcClientConstructor() { + void testCdsProcessorGrpcClientConstructor() { assertThatCode(() -> new CdsProcessorGrpcClient(listener, props).close()).doesNotThrowAnyException(); } - @Test(expected = IllegalStateException.class) - public void testCdsProcessorGrpcClientConstructorFailure() { + @Test + void testCdsProcessorGrpcClientConstructorFailure() { props.setHost(null); - new CdsProcessorGrpcClient(listener, props).close(); + assertThrows(IllegalStateException.class, () -> { + new CdsProcessorGrpcClient(listener, props).close(); + }); } @Test - public void testSendRequestFail() throws InterruptedException { + void testSendRequestFail() throws InterruptedException { // Setup ExecutionServiceInput testReq = ExecutionServiceInput.newBuilder() .setActionIdentifiers(ActionIdentifiers.newBuilder().setActionName("policy-to-cds").build()) @@ -154,7 +173,7 @@ public class CdsProcessorGrpcClientTest { } @Test - public void testSendRequestSuccess() throws InterruptedException { + void testSendRequestSuccess() throws InterruptedException { // Setup request ExecutionServiceInput testReq1 = ExecutionServiceInput.newBuilder() .setActionIdentifiers(ActionIdentifiers.newBuilder().setActionName("policy-to-cds-req1").build()).build(); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/AbatedTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/AbatedTest.java index 22ef769f9..a2be4e662 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/AbatedTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/AbatedTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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,16 +22,16 @@ package org.onap.policy.controlloop; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import java.time.Instant; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AbatedTest { +class AbatedTest { @Test - public void testConstructors() { + void testConstructors() { VirtualControlLoopEvent event = new VirtualControlLoopEvent(); event.setClosedLoopEventStatus(ControlLoopEventStatus.ABATED); event.setClosedLoopAlarmStart(Instant.now()); @@ -48,7 +49,7 @@ public class AbatedTest { } @Test - public void testSetClosedLoopEventStatus() { + void testSetClosedLoopEventStatus() { assertThatIllegalArgumentException() .isThrownBy(() -> new Abated().setClosedLoopEventStatus(ControlLoopEventStatus.ONSET)); } diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalAbatedTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalAbatedTest.java index 5aa7497e9..a2d18abb5 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalAbatedTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalAbatedTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,17 +21,17 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import java.time.Instant; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CanonicalAbatedTest { +class CanonicalAbatedTest { @Test - public void testConstructors() { + void testConstructors() { CanonicalAbated abated1 = new CanonicalAbated(new VirtualControlLoopEvent()); abated1.setRequestId(UUID.randomUUID()); abated1.setClosedLoopAlarmStart(Instant.now()); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalOnsetTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalOnsetTest.java index 23e1fffbd..01eaa3d6a 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalOnsetTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/CanonicalOnsetTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,17 +21,17 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import java.time.Instant; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CanonicalOnsetTest { +class CanonicalOnsetTest { @Test - public void testConstructors() { + void testConstructors() { CanonicalOnset onset1 = new CanonicalOnset(new VirtualControlLoopEvent()); onset1.setRequestId(UUID.randomUUID()); onset1.setClosedLoopAlarmStart(Instant.now()); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java index f890cfce8..7598e0e6d 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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.controlloop; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ControlLoopEventStatusTest { +class ControlLoopEventStatusTest { @Test - public void test() { + void test() { ControlLoopEventStatus status = ControlLoopEventStatus.ABATED; assertEquals(ControlLoopEventStatus.ABATED, ControlLoopEventStatus.toStatus(status.toString())); assertNotEquals(ControlLoopEventStatus.ONSET, ControlLoopEventStatus.toStatus(status.toString())); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java index 2def97572..a1d619cd3 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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,14 +21,14 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ControlLoopEventTest { +class ControlLoopEventTest { private class TestControlLoopEvent extends ControlLoopEvent { private static final long serialVersionUID = 1L; @@ -43,7 +43,7 @@ public class ControlLoopEventTest { } @Test - public void test() { + void test() { ControlLoopEvent event = new TestControlLoopEvent(); assertEquals("1.0.2", event.getVersion()); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java index 2ad097254..68c5bc203 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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,17 +21,17 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.util.Collections; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.policy.controlloop.util.Serialization; -public class ControlLoopNotificationTest { +class ControlLoopNotificationTest { private class TestControlLoopNotification extends ControlLoopNotification { private static final long serialVersionUID = 1L; @@ -46,7 +46,7 @@ public class ControlLoopNotificationTest { } @Test - public void test() { + void test() { ControlLoopNotification notification = new TestControlLoopNotification(); assertEquals("1.0.2", notification.getVersion()); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java index a8330ba2e..06539852a 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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.controlloop; -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 ControlLoopNotificationTypeTest { +class ControlLoopNotificationTypeTest { @Test - public void test() { + void test() { assertEquals(ControlLoopNotificationType.ACTIVE, ControlLoopNotificationType.toType("ACTIVE")); assertEquals(ControlLoopNotificationType.REJECTED, ControlLoopNotificationType.toType("REJECTED")); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java index eaf4ea93a..4770000c8 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-2020 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,18 +21,18 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -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.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.Instant; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ControlLoopOperationTest { +class ControlLoopOperationTest { @Test - public void test() { + void test() { ControlLoopOperation operation = new ControlLoopOperation(); assertEquals(operation, (Object) operation); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java index 46fd9de96..eaf7f5ef4 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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,16 +21,16 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ControlLoopOperationWrapperTest { +class ControlLoopOperationWrapperTest { @Test - public void test() { + void test() { ControlLoopOperationWrapper wrapper = new ControlLoopOperationWrapper(); assertNotNull(wrapper); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java index b0f64eb0f..5fc4b35d7 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2019 Wipro Limited Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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 +22,15 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ControlLoopResponseTest { +class ControlLoopResponseTest { @Test - public void test() { + void test() { ControlLoopResponse rsp = new ControlLoopResponse(); assertEquals("1.0.0", rsp.getVersion()); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/OnsetTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/OnsetTest.java index 5dadff1b6..641af7ee4 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/OnsetTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/OnsetTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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,16 +22,16 @@ package org.onap.policy.controlloop; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import java.time.Instant; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class OnsetTest { +class OnsetTest { @Test - public void testConstructors() { + void testConstructors() { VirtualControlLoopEvent event = new VirtualControlLoopEvent(); event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET); event.setClosedLoopAlarmStart(Instant.now()); @@ -49,7 +50,7 @@ public class OnsetTest { } @Test - public void testSetClosedLoopEventStatus() { + void testSetClosedLoopEventStatus() { assertThatIllegalArgumentException() .isThrownBy(() -> new Onset().setClosedLoopEventStatus(ControlLoopEventStatus.ABATED)); } diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java index 80f043e6b..88a8e4300 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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,14 +21,14 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PhysicalControlLoopEventTest { +class PhysicalControlLoopEventTest { @Test - public void test() { + void test() { PhysicalControlLoopEvent event = new PhysicalControlLoopEvent(); assertNotNull(event); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java index f52bbc9bf..8b4f89a75 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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,14 +21,14 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PhysicalControlLoopNotificationTest { +class PhysicalControlLoopNotificationTest { @Test - public void test() { + void test() { PhysicalControlLoopNotification notification = new PhysicalControlLoopNotification(); assertNotNull(notification); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java index 3fc7d133e..78b134015 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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,17 +21,17 @@ package org.onap.policy.controlloop; -import static org.junit.Assert.assertEquals; -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.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.time.Instant; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VirtualControlLoopEventTest { +class VirtualControlLoopEventTest { @Test - public void test() { + void test() { VirtualControlLoopEvent event = new VirtualControlLoopEvent(); assertNotNull(event); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java index 2ab622230..cf517e261 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java @@ -3,7 +3,7 @@ * controlloop * ================================================================================ * Copyright (C) 2018-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,18 +21,18 @@ package org.onap.policy.controlloop; -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.time.Instant; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VirtualControlLoopNotificationTest { +class VirtualControlLoopNotificationTest { @Test - public void test() { + void test() { VirtualControlLoopNotification notification = new VirtualControlLoopNotification(); assertNotNull(notification); diff --git a/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java b/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java index 47bdb4c36..9cc520f17 100644 --- a/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java +++ b/models-interactions/model-impl/guard/src/test/java/org/onap/policy/guard/OperationsHistoryTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -18,17 +19,17 @@ package org.onap.policy.guard; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Date; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class OperationsHistoryTest { +class OperationsHistoryTest { @Test - public void test() { + void test() { OperationsHistory dao = new OperationsHistory(); dao.setActor("my-actor"); diff --git a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java index 8579bf1bd..23c9cea3b 100644 --- a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java +++ b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java @@ -3,7 +3,7 @@ * rest * ================================================================================ * Copyright (C) 2018 Amdocs. 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,18 +21,18 @@ package org.onap.policy.rest; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpDeleteWithBodyTest { +class HttpDeleteWithBodyTest { private static final String NO_URI = "BlahBlah"; @Test - public void testGetMethod() { + void testGetMethod() { HttpDeleteWithBody deleteWithBody = new HttpDeleteWithBody(NO_URI); assertEquals("DELETE", deleteWithBody.getMethod()); - assertEquals(NO_URI, deleteWithBody.getURI().toString()); + assertEquals(deleteWithBody.getURI().toString(), NO_URI); } }
\ No newline at end of file diff --git a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java index e6c819153..28136e667 100644 --- a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java +++ b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java @@ -3,7 +3,7 @@ * rest * ================================================================================ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation. + * Modifications Copyright (C) 2019-2020, 2023-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,9 +21,10 @@ package org.onap.policy.rest; -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.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; @@ -43,9 +44,9 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.apache.commons.lang3.tuple.Pair; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.onap.policy.common.endpoints.http.server.HttpServletServer; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; import org.onap.policy.common.utils.network.NetworkUtil; @@ -79,7 +80,7 @@ public class RestTest { /** * Sets server endpoint for the tests. */ - @BeforeClass + @BeforeAll public static void setUp() throws Exception { port = NetworkUtil.allocPort(); @@ -105,39 +106,49 @@ public class RestTest { * * @throws Exception if there is a problem */ - @AfterClass + @AfterAll public static void tearDown() throws Exception { HttpServletServerFactoryInstance.getServerFactory().destroy(); } - @Test(expected = NullPointerException.class) + @Test public void testGetUrlNull() { RestManager mgr = new RestManager(); - mgr.get(null, "user", null, null); + assertThrows(NullPointerException.class, () -> { + mgr.get(null, "user", null, null); + }); } - @Test(expected = NullPointerException.class) + @Test public void testPutUrlNull() { RestManager mgr = new RestManager(); - mgr.put(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD); + assertThrows(NullPointerException.class, () -> { + mgr.put(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD); + }); } - @Test(expected = NullPointerException.class) + @Test public void testPostUrlNull() { RestManager mgr = new RestManager(); - mgr.post(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD); + assertThrows(NullPointerException.class, () -> { + mgr.post(null, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD); + }); } - @Test(expected = NullPointerException.class) + @Test public void testDeleteUrlNull() { RestManager mgr = new RestManager(); - mgr.delete(null, "user", null, null, null, null); + assertThrows(NullPointerException.class, () -> { + mgr.delete(null, "user", null, null, null, null); + }); } - @Test(expected = NullPointerException.class) + @Test public void testPatchUrlNull() { RestManager mgr = new RestManager(); - mgr.patch(null, "user", null, null, PAYLOAD); + assertThrows(NullPointerException.class, () -> { + mgr.patch(null, "user", null, null, PAYLOAD); + }); } @Test diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/DemoTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/DemoTest.java index 7b5ad46c5..3b5e9a40d 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/DemoTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/DemoTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Huawei. 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"); @@ -20,18 +20,18 @@ package org.onap.policy.sdnc; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.policy.sdnc.util.Serialization; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class DemoTest { +class DemoTest { private static final Logger logger = LoggerFactory.getLogger(DemoTest.class); @Test - public void test() { + void test() { SdncRequest request = new SdncRequest(); request.setNsInstanceId("100"); diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealAdditionalParamsTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealAdditionalParamsTest.java index 8cd10eb56..5a76346e6 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealAdditionalParamsTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealAdditionalParamsTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Huawei. 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,16 +21,16 @@ package org.onap.policy.sdnc; -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 SdncHealAdditionalParamsTest { +class SdncHealAdditionalParamsTest { @Test - public void testSdncHealAdditionalParameters() { + void testSdncHealAdditionalParameters() { SdncHealRequestHeaderInfo additionalParams = new SdncHealRequestHeaderInfo(); assertNotNull(additionalParams); assertNotEquals(0, additionalParams.hashCode()); diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealRequestTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealRequestTest.java index 1412bbb6e..2bf0d137e 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealRequestTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealRequestTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Huawei. 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,16 +21,16 @@ package org.onap.policy.sdnc; -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 SdncHealRequestTest { +class SdncHealRequestTest { @Test - public void testSdncHealRequest() { + void testSdncHealRequest() { SdncHealRequest request = new SdncHealRequest(); assertNotNull(request); assertNotEquals(0, request.hashCode()); diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealServiceInfoTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealServiceInfoTest.java index 770feb4bb..251cb0156 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealServiceInfoTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncHealServiceInfoTest.java @@ -3,7 +3,7 @@ * sdnc * ================================================================================ * Copyright (C) 2018 Huawei. 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,16 +21,16 @@ package org.onap.policy.sdnc; -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 SdncHealServiceInfoTest { +class SdncHealServiceInfoTest { @Test - public void testSdncHealServiceInfo() { + void testSdncHealServiceInfo() { SdncHealServiceInfo serviceInfo = new SdncHealServiceInfo(); assertNotNull(serviceInfo); assertNotEquals(0, serviceInfo.hashCode()); diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncRequestTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncRequestTest.java index 6dc6fa2d5..4448baf2b 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncRequestTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncRequestTest.java @@ -3,7 +3,7 @@ * sdnc * ================================================================================ * Copyright (C) 2018 Huawei. 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.sdnc; -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.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SdncRequestTest { +class SdncRequestTest { @Test - public void testSdncRequest() { + void testSdncRequest() { SdncRequest request = new SdncRequest(); assertNotNull(request); assertNotEquals(0, request.hashCode()); diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseDescriptorTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseDescriptorTest.java index a397bdcab..c15428e6e 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseDescriptorTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseDescriptorTest.java @@ -3,7 +3,7 @@ * sdnc * ================================================================================ * Copyright (C) 2018 Huawei. 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,16 +21,16 @@ package org.onap.policy.sdnc; -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 SdncResponseDescriptorTest { +class SdncResponseDescriptorTest { @Test - public void testSdncResponseDescriptor() { + void testSdncResponseDescriptor() { SdncResponseOutput output = new SdncResponseOutput(); assertNotNull(output); assertNotEquals(0, output.hashCode()); diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseTest.java index b36a72810..b0541637e 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/SdncResponseTest.java @@ -3,7 +3,7 @@ * sdnc * ================================================================================ * Copyright (C) 2018 Huawei. 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,16 +21,16 @@ package org.onap.policy.sdnc; -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 SdncResponseTest { +class SdncResponseTest { @Test - public void testSdncResponse() { + void testSdncResponse() { SdncResponse response = new SdncResponse(); assertNotNull(response); assertNotEquals(0, response.hashCode()); diff --git a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/util/SerializationTest.java b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/util/SerializationTest.java index 9dfb3742e..200c71892 100644 --- a/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/util/SerializationTest.java +++ b/models-interactions/model-impl/sdnc/src/test/java/org/onap/policy/sdnc/util/SerializationTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Huawei. 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,14 +21,14 @@ package org.onap.policy.sdnc.util; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SerializationTest { +class SerializationTest { @Test - public void test() { + void test() { assertNotNull(Serialization.gsonPretty); } } 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); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/DemoTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/DemoTest.java index e45ee0aea..3295b8a6f 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/DemoTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/DemoTest.java @@ -3,7 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2017-2020 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,20 +21,20 @@ package org.onap.policy.so; -import static org.junit.Assert.assertNotNull; +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; import org.onap.policy.so.util.Serialization; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class DemoTest { +class DemoTest { private static final Logger logger = LoggerFactory.getLogger(DemoTest.class); @Test - public void test() { + void test() { SoRequest request = new SoRequest(); request.setRequestDetails(new SoRequestDetails()); @@ -108,7 +108,7 @@ public class DemoTest { } @Test - public void testHack() { + void testHack() { logger.debug("** HACK **"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoAsyncRequestStatusTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoAsyncRequestStatusTest.java index 4aa2db37c..e868789a6 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoAsyncRequestStatusTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoAsyncRequestStatusTest.java @@ -4,7 +4,7 @@ * ================================================================================ * * Modifications Copyright (C) 2019-2020 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,16 +22,16 @@ package org.onap.policy.so; -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 java.time.LocalDateTime; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoAsyncRequestStatusTest { +class SoAsyncRequestStatusTest { @Test - public void testConstructor() { + void testConstructor() { SoAsyncRequestStatus obj = new SoAsyncRequestStatus(); assertNull(obj.getCorrelator()); @@ -44,7 +44,7 @@ public class SoAsyncRequestStatusTest { } @Test - public void testSetGet() { + void testSetGet() { SoAsyncRequestStatus obj = new SoAsyncRequestStatus(); obj.setCorrelator("correlator"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoCloudConfigurationTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoCloudConfigurationTest.java index 59626f45d..f54d41aaa 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoCloudConfigurationTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoCloudConfigurationTest.java @@ -4,7 +4,7 @@ * ================================================================================ * * Modifications Copyright (C) 2019-2020 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,15 +22,15 @@ package org.onap.policy.so; -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 SoCloudConfigurationTest { +class SoCloudConfigurationTest { @Test - public void testConstructor() { + void testConstructor() { SoCloudConfiguration obj = new SoCloudConfiguration(); assertNull(obj.getLcpCloudRegionId()); @@ -38,7 +38,7 @@ public class SoCloudConfigurationTest { } @Test - public void testSetGet() { + void testSetGet() { SoCloudConfiguration obj = new SoCloudConfiguration(); obj.setLcpCloudRegionId("lcpCloudRegionId"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java index bb7e85144..850d543cc 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java @@ -34,7 +34,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @Path("/SO") -public class SoDummyServer { +class SoDummyServer { private static final String ONGOING = "ONGOING"; private static int postMessagesReceived = 0; diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoInstanceReferencesTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoInstanceReferencesTest.java index b8e01c6c1..374e4727d 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoInstanceReferencesTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoInstanceReferencesTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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.so; -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 SoInstanceReferencesTest { +class SoInstanceReferencesTest { @Test - public void testConstructor() { + void testConstructor() { SoInstanceReferences obj = new SoInstanceReferences(); assertNull(obj.getInstanceId()); @@ -37,7 +37,7 @@ public class SoInstanceReferencesTest { } @Test - public void testSetGet() { + void testSetGet() { SoInstanceReferences obj = new SoInstanceReferences(); obj.setInstanceId("instanceId"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoModelInfoTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoModelInfoTest.java index a9f5baaba..09bbc128f 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoModelInfoTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoModelInfoTest.java @@ -4,7 +4,7 @@ * ================================================================================ * * Modifications Copyright (C) 2019-2020 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,15 +22,15 @@ package org.onap.policy.so; -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 SoModelInfoTest { +class SoModelInfoTest { @Test - public void testConstructor() { + void testConstructor() { SoModelInfo obj = new SoModelInfo(); assertNull(obj.getModelCustomizationId()); @@ -43,7 +43,7 @@ public class SoModelInfoTest { } @Test - public void testSetGet() { + void testSetGet() { SoModelInfo obj = new SoModelInfo(); obj.setModelCustomizationId("modelCustomizationId"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoPolicyExceptionHolderTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoPolicyExceptionHolderTest.java index e6fc8fee9..3bc6f3d24 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoPolicyExceptionHolderTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoPolicyExceptionHolderTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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.so; -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 SoPolicyExceptionHolderTest { +class SoPolicyExceptionHolderTest { @Test - public void testConstructor() { + void testConstructor() { SoPolicyExceptionHolder obj = new SoPolicyExceptionHolder(); assertNull(obj.getMessageId()); @@ -37,7 +37,7 @@ public class SoPolicyExceptionHolderTest { } @Test - public void testSetGet() { + void testSetGet() { SoPolicyExceptionHolder obj = new SoPolicyExceptionHolder(); obj.setMessageId("messageId"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceListElementTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceListElementTest.java index b6c2e0671..d493abe7a 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceListElementTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceListElementTest.java @@ -4,7 +4,7 @@ * ================================================================================ * * Modifications Copyright (C) 2019-2020 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.so; -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 SoRelatedInstanceListElementTest { +class SoRelatedInstanceListElementTest { @Test - public void testConstructor() { + void testConstructor() { SoRelatedInstanceListElement obj = new SoRelatedInstanceListElement(); assertNull(obj.getRelatedInstance()); } @Test - public void testSetGet() { + void testSetGet() { SoRelatedInstanceListElement obj = new SoRelatedInstanceListElement(); SoRelatedInstance relatedInstance = new SoRelatedInstance(); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceTest.java index f215d0184..7be735222 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRelatedInstanceTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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.so; -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 SoRelatedInstanceTest { +class SoRelatedInstanceTest { @Test - public void testConstructor() { + void testConstructor() { SoRelatedInstance obj = new SoRelatedInstance(); assertNull(obj.getInstanceId()); @@ -38,7 +38,7 @@ public class SoRelatedInstanceTest { } @Test - public void testSetGet() { + void testSetGet() { SoRelatedInstance obj = new SoRelatedInstance(); obj.setInstanceId("instanceId"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequest3gppTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequest3gppTest.java index a7369120c..834d8a8a4 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequest3gppTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequest3gppTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 Wipro Limited. + * Modifications Copyright (C) 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. @@ -28,12 +29,12 @@ import com.openpojo.validation.rule.impl.GetterMustExistRule; import com.openpojo.validation.rule.impl.SetterMustExistRule; import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoRequest3gppTest { +class SoRequest3gppTest { @Test - public void testSetGet() { + void testSetGet() { PojoClass pojoClass = PojoClassFactory.getPojoClass(SoRequest3gpp.class); Validator validator = ValidatorBuilder .create() diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestCllTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestCllTest.java index 3d3168656..8c7de5042 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestCllTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestCllTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2022 CTC Intellectual Property. All rights reserved. + * Modifications Copyright (C) 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. @@ -28,12 +29,12 @@ import com.openpojo.validation.rule.impl.GetterMustExistRule; import com.openpojo.validation.rule.impl.SetterMustExistRule; import com.openpojo.validation.test.impl.GetterTester; import com.openpojo.validation.test.impl.SetterTester; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoRequestCllTest { +class SoRequestCllTest { @Test - public void testSetGet() { + void testSetGet() { PojoClass pojoClass = PojoClassFactory.getPojoClass(SoRequestCll.class); Validator validator = ValidatorBuilder .create() diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java index 4866f3ba1..98a828979 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java @@ -4,7 +4,7 @@ * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 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,20 +22,20 @@ package org.onap.policy.so; -import static org.junit.Assert.assertEquals; -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.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.util.ArrayList; import java.util.List; import java.util.function.BiConsumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoRequestDetailsTest { +class SoRequestDetailsTest { @Test - public void testConstructor() { + void testConstructor() { SoRequestDetails obj = new SoRequestDetails(); assertNull(obj.getCloudConfiguration()); @@ -49,7 +49,7 @@ public class SoRequestDetailsTest { } @Test - public void testSetGet() { + void testSetGet() { SoRequestDetails obj = new SoRequestDetails(); SoCloudConfiguration cloudConfiguration = new SoCloudConfiguration(); @@ -74,7 +74,7 @@ public class SoRequestDetailsTest { } @Test - public void testSoMRequestDetailsMethods() { + void testSoMRequestDetailsMethods() { SoRequestDetails details = new SoRequestDetails(); assertNotNull(details); assertNotEquals(0, details.hashCode()); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestErrorTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestErrorTest.java index f70e598f2..265bb9023 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestErrorTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestErrorTest.java @@ -4,7 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 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. @@ -22,15 +22,15 @@ package org.onap.policy.so; -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 SoRequestErrorTest { +class SoRequestErrorTest { @Test - public void testConstructor() { + void testConstructor() { SoRequestError obj = new SoRequestError(); assertNull(obj.getPolicyException()); @@ -38,7 +38,7 @@ public class SoRequestErrorTest { } @Test - public void testSetGet() { + void testSetGet() { SoRequestError obj = new SoRequestError(); SoPolicyExceptionHolder policyException = new SoPolicyExceptionHolder(); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestInfoTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestInfoTest.java index dd7db84f3..8bc420273 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestInfoTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestInfoTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * 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,16 +21,16 @@ package org.onap.policy.so; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -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.assertNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoRequestInfoTest { +class SoRequestInfoTest { @Test - public void testConstructor() { + void testConstructor() { SoRequestInfo obj = new SoRequestInfo(); assertNull(obj.getBillingAccountNumber()); @@ -46,7 +46,7 @@ public class SoRequestInfoTest { } @Test - public void testSetGet() { + void testSetGet() { SoRequestInfo obj = new SoRequestInfo(); obj.setBillingAccountNumber("billingAccountNumber"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestParametersTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestParametersTest.java index 563e28d31..0159c8e59 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestParametersTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestParametersTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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,16 +21,16 @@ package org.onap.policy.so; -import static org.junit.Assert.assertEquals; -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.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoRequestParametersTest { +class SoRequestParametersTest { @Test - public void testConstructor() { + void testConstructor() { SoRequestParameters obj = new SoRequestParameters(); assertNull(obj.getSubscriptionServiceType()); @@ -39,7 +39,7 @@ public class SoRequestParametersTest { } @Test - public void testSetGet() { + void testSetGet() { SoRequestParameters obj = new SoRequestParameters(); obj.setSubscriptionServiceType("subscriptionServiceType"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestReferencesTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestReferencesTest.java index 83172dee2..43e3eb93b 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestReferencesTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestReferencesTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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.so; -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 SoRequestReferencesTest { +class SoRequestReferencesTest { @Test - public void testConstructor() { + void testConstructor() { SoRequestReferences obj = new SoRequestReferences(); assertNull(obj.getInstanceId()); @@ -37,7 +37,7 @@ public class SoRequestReferencesTest { } @Test - public void testSetGet() { + void testSetGet() { SoRequestReferences obj = new SoRequestReferences(); obj.setInstanceId("instanceId"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestStatusTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestStatusTest.java index 2b0c572ce..3b57daae8 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestStatusTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestStatusTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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,17 +21,17 @@ package org.onap.policy.so; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoRequestStatusTest { +class SoRequestStatusTest { @Test - public void testConstructor() { + void testConstructor() { SoRequestStatus obj = new SoRequestStatus(); assertEquals(0, obj.getPercentProgress()); @@ -41,7 +41,7 @@ public class SoRequestStatusTest { } @Test - public void testSetGet() { + void testSetGet() { SoRequestStatus obj = new SoRequestStatus(); obj.setPercentProgress(2008); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestTest.java index 959016445..6951a800a 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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,17 +21,17 @@ package org.onap.policy.so; -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 java.time.LocalDateTime; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoRequestTest { +class SoRequestTest { @Test - public void testConstructor() { + void testConstructor() { SoRequest obj = new SoRequest(); assertNull(obj.getFinishTime()); @@ -44,7 +44,7 @@ public class SoRequestTest { } @Test - public void testSetGet() { + void testSetGet() { SoRequest obj = new SoRequest(); LocalDateTime finishTime = LocalDateTime.now(); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseTest.java index c75aa9ec9..c2691060d 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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.so; -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 SoResponseTest { +class SoResponseTest { @Test - public void testConstructor() { + void testConstructor() { SoResponse obj = new SoResponse(); assertEquals(0, obj.getHttpResponseCode()); @@ -39,7 +39,7 @@ public class SoResponseTest { } @Test - public void testSetGet() { + void testSetGet() { SoResponse obj = new SoResponse(); obj.setHttpResponseCode(2008); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java index 42f57c7e4..f33bfd72f 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoResponseWrapperTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2018-2020 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,19 +21,19 @@ package org.onap.policy.so; -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.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoResponseWrapperTest { +class SoResponseWrapperTest { private static final String REQ_ID = "reqID"; @Test - public void testConstructor() { + void testConstructor() { SoResponse response = new SoResponse(); SoResponseWrapper obj = new SoResponseWrapper(response, REQ_ID); @@ -42,7 +42,7 @@ public class SoResponseWrapperTest { } @Test - public void testSetGet() { + void testSetGet() { SoResponse response = new SoResponse(); SoResponseWrapper obj = new SoResponseWrapper(response, REQ_ID); @@ -56,7 +56,7 @@ public class SoResponseWrapperTest { } @Test - public void testSoResponseWrapperMethods() { + void testSoResponseWrapperMethods() { String requestId = UUID.randomUUID().toString(); SoResponse response = new SoResponse(); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoServiceExceptionHolderTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoServiceExceptionHolderTest.java index 981db650d..ac94dd24e 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoServiceExceptionHolderTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoServiceExceptionHolderTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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,16 +21,16 @@ package org.onap.policy.so; -import static org.junit.Assert.assertEquals; -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.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SoServiceExceptionHolderTest { +class SoServiceExceptionHolderTest { @Test - public void testConstructor() { + void testConstructor() { SoServiceExceptionHolder obj = new SoServiceExceptionHolder(); assertNull(obj.getMessageId()); @@ -40,7 +40,7 @@ public class SoServiceExceptionHolderTest { } @Test - public void testSetGet() { + void testSetGet() { SoServiceExceptionHolder obj = new SoServiceExceptionHolder(); obj.setMessageId("messageId"); diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoSubscriberInfoTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoSubscriberInfoTest.java index 56278b0a9..fa2a89040 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoSubscriberInfoTest.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoSubscriberInfoTest.java @@ -3,7 +3,7 @@ * so * ================================================================================ * Copyright (C) 2017-2020 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.so; -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 SoSubscriberInfoTest { +class SoSubscriberInfoTest { @Test - public void testConstructor() { + void testConstructor() { SoSubscriberInfo obj = new SoSubscriberInfo(); assertNull(obj.getGlobalSubscriberId()); @@ -38,7 +38,7 @@ public class SoSubscriberInfoTest { } @Test - public void testSetGet() { + void testSetGet() { SoSubscriberInfo obj = new SoSubscriberInfo(); obj.setGlobalSubscriberId("globalSubscriberId"); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/DemoTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/DemoTest.java index f66e9ecd6..4b23e4080 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/DemoTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/DemoTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2017-2019 Intel Corp. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018-2020 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,19 +20,19 @@ package org.onap.policy.vfc; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.onap.policy.vfc.util.Serialization; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class DemoTest { +class DemoTest { private static final Logger logger = LoggerFactory.getLogger(DemoTest.class); @Test - public void test() { + void test() { VfcRequest request = new VfcRequest(); request.setNsInstanceId("100"); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealActionVmInfoTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealActionVmInfoTest.java index 49dd06eef..f06874bdf 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealActionVmInfoTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealActionVmInfoTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,16 +22,16 @@ package org.onap.policy.vfc; -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 VfcHealActionVmInfoTest { +class VfcHealActionVmInfoTest { @Test - public void testVfcHealActionVmInfo() { + void testVfcHealActionVmInfo() { VfcHealActionVmInfo actionInfo = new VfcHealActionVmInfo(); assertNotNull(actionInfo); assertNotEquals(0, actionInfo.hashCode()); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealAdditionalParamsTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealAdditionalParamsTest.java index acaad2082..622f94b5b 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealAdditionalParamsTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealAdditionalParamsTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,16 +22,16 @@ package org.onap.policy.vfc; -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 VfcHealAdditionalParamsTest { +class VfcHealAdditionalParamsTest { @Test - public void testVfcHealAdditionalParameters() { + void testVfcHealAdditionalParameters() { VfcHealAdditionalParams additionalParams = new VfcHealAdditionalParams(); assertNotNull(additionalParams); assertNotEquals(0, additionalParams.hashCode()); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealRequestTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealRequestTest.java index a4fc65912..570817309 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealRequestTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcHealRequestTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,16 +22,16 @@ package org.onap.policy.vfc; -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 VfcHealRequestTest { +class VfcHealRequestTest { @Test - public void testVfcHealRequest() { + void testVfcHealRequest() { VfcHealRequest request = new VfcHealRequest(); assertNotNull(request); assertNotEquals(0, request.hashCode()); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcRequestTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcRequestTest.java index ec222e9be..fe16a93e9 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcRequestTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcRequestTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,17 +22,17 @@ package org.onap.policy.vfc; -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.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VfcRequestTest { +class VfcRequestTest { @Test - public void testVfcRequest() { + void testVfcRequest() { VfcRequest request = new VfcRequest(); assertNotNull(request); assertNotEquals(0, request.hashCode()); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseDescriptorTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseDescriptorTest.java index e85502d45..d88d593f7 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseDescriptorTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseDescriptorTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,18 +22,18 @@ package org.onap.policy.vfc; -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.ArrayList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VfcResponseDescriptorTest { +class VfcResponseDescriptorTest { @Test - public void testVfcResponseDescriptor() { + void testVfcResponseDescriptor() { VfcResponseDescriptor descriptor = new VfcResponseDescriptor(); assertNotNull(descriptor); assertNotEquals(0, descriptor.hashCode()); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseTest.java index 196ae2f63..4e1c9a1c9 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/VfcResponseTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018-2019 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,16 +22,16 @@ package org.onap.policy.vfc; -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 VfcResponseTest { +class VfcResponseTest { @Test - public void testVfcResponse() { + void testVfcResponse() { VfcResponse response = new VfcResponse(); assertNotNull(response); assertNotEquals(0, response.hashCode()); diff --git a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/util/SerializationTest.java b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/util/SerializationTest.java index 983760a03..4d31d75b3 100644 --- a/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/util/SerializationTest.java +++ b/models-interactions/model-impl/vfc/src/test/java/org/onap/policy/vfc/util/SerializationTest.java @@ -3,7 +3,7 @@ * vfc * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2018 AT&T Corporation. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,14 +22,14 @@ package org.onap.policy.vfc.util; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SerializationTest { +class SerializationTest { @Test - public void test() { + void test() { assertNotNull(Serialization.gsonPretty); } } |