* 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");
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;
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;
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);
}
+ @AfterEach
+ public void tearDown() throws Exception {
+ closeable.close();
+ }
+
/**
* Initialize services to the provider for tests.
*
* 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) {