diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-08-17 22:09:58 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2023-08-17 22:10:28 +0100 |
commit | 08d36423f39ad97783221b6144111a663b6fbfc8 (patch) | |
tree | 2df4d626cb4a303c5051e0c988fb40e6de76aa74 /main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java | |
parent | eb4cf2ad5d004cbfda90a752d10fbc6e91ef8fb4 (diff) |
Java 17 / Spring 6 / Spring Boot 3 Upgrade
Issue-ID: POLICY-4671
Change-Id: I249416af830db638a314325e45948015a21134d4
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java')
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java b/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java index 60de563e..e5a83305 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/ProviderSuper.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2021-2022 Nordix Foundation. + * Modifications Copyright (C) 2021-2023 Nordix Foundation. * Modifications Copyright (C) 2022-2023 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,7 @@ package org.onap.policy.pap.main.rest; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -37,7 +37,8 @@ import java.util.Comparator; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; @@ -95,15 +96,17 @@ public class ProviderSuper { protected ToscaPolicy policy1; protected MeterRegistry meterRegistry; + AutoCloseable closeable; + /** * Configures DAO, captors, and various mocks. */ - @Before + @BeforeEach public void setUp() throws Exception { Registry.newRegistry(); - MockitoAnnotations.openMocks(this); + closeable = MockitoAnnotations.openMocks(this); reqmap = mock(PdpModifyRequestMap.class); @@ -125,6 +128,11 @@ public class ProviderSuper { } + @AfterEach + public void tearDown() throws Exception { + closeable.close(); + } + /** * Initialize services to the provider for tests. * @@ -280,7 +288,7 @@ public class ProviderSuper { * Loads an object from a JSON file. * * @param fileName name of the file from which to load - * @param clazz the class of the object to be loaded + * @param clazz the class of the object to be loaded * @return the object that was loaded from the file */ protected <T> T loadFile(String fileName, Class<T> clazz) { |