From 349b4ae7179173f9261d9a432094cb55dc433820 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Fri, 21 Jul 2023 09:41:01 +0100 Subject: Java 17 Upgrade Issue-ID: POLICY-4668 Change-Id: If4e79224de61d66d7514f3abbd7b8bee1c3d5681 Signed-off-by: adheli.tavares --- .../policy/common/utils/cmd/TestCommandLineArguments.java | 4 ++-- .../onap/policy/common/utils/jpa/EntityMgrCloserTest.java | 3 ++- .../common/utils/jpa/EntityMgrFactoryCloserTest.java | 3 ++- .../policy/common/utils/jpa/EntityTransCloserTest.java | 3 ++- .../policy/common/utils/resources/ResourceUtilsTest.java | 14 +++++++------- 5 files changed, 15 insertions(+), 12 deletions(-) (limited to 'utils/src/test') diff --git a/utils/src/test/java/org/onap/policy/common/utils/cmd/TestCommandLineArguments.java b/utils/src/test/java/org/onap/policy/common/utils/cmd/TestCommandLineArguments.java index 1501e769..b45f107d 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/cmd/TestCommandLineArguments.java +++ b/utils/src/test/java/org/onap/policy/common/utils/cmd/TestCommandLineArguments.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021 Nordix Foundation. + * Copyright (C) 2021, 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,7 @@ public class TestCommandLineArguments { @Test public void testParse_ShouldThrowExceptionWhenFileNameNull() { String[] nullArgs = {"-c", null}; - assertThatThrownBy(() -> testCmd.parse(nullArgs)).hasMessage(ERR_MSG_INVALID_ARGS).hasRootCauseMessage(null); + assertThatThrownBy(() -> testCmd.parse(nullArgs)).hasMessage(ERR_MSG_INVALID_ARGS); } @Test diff --git a/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrCloserTest.java b/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrCloserTest.java index b8730a65..17d7f7ff 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrCloserTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrCloserTest.java @@ -3,6 +3,7 @@ * Common Utils * ================================================================================ * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +26,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import org.junit.Before; import org.junit.Test; diff --git a/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloserTest.java b/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloserTest.java index 3981e2af..0e8edca2 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloserTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloserTest.java @@ -3,6 +3,7 @@ * Common Utils * ================================================================================ * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +26,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import org.junit.Before; import org.junit.Test; diff --git a/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityTransCloserTest.java b/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityTransCloserTest.java index 18b39d26..dc63c673 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityTransCloserTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/jpa/EntityTransCloserTest.java @@ -3,6 +3,7 @@ * Common Utils * ================================================================================ * Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +28,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import javax.persistence.EntityTransaction; +import jakarta.persistence.EntityTransaction; import org.junit.Before; import org.junit.Test; diff --git a/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java b/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java index 54e17209..a39b4fc2 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2020-2021 Nordix Foundation. + * Modifications Copyright (C) 2020-2021, 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,12 +77,12 @@ public class ResourceUtilsTest { } /** - * Cleandown resource utils test. + * Clean resource utils test. */ @After - public void cleandownResourceUtilsTest() { - tmpEmptyFile.delete(); - tmpUsedFile.delete(); + public void cleanDownResourceUtilsTest() { + assertTrue(tmpEmptyFile.delete()); + assertTrue(tmpUsedFile.delete()); } /** @@ -312,8 +312,8 @@ public class ResourceUtilsTest { normalizePath(resultD2.iterator().next())); Set resultJ0 = ResourceUtils.getDirectoryContents("com"); - assertTrue(resultJ0.contains("com/google/gson/")); - assertEquals("com/google/", normalizePath(resultJ0.iterator().next())); + assertTrue(resultJ0.contains("com/worldturner/medeia/")); + assertEquals("com/worldturner/", normalizePath(resultJ0.iterator().next())); Set resultJ1 = ResourceUtils.getDirectoryContents("com/google/gson"); assertTrue(resultJ1.size() > 1); -- cgit 1.2.3-korg