2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.components.scheduledtasks;
23 import java.util.concurrent.ExecutorService;
24 import org.junit.jupiter.api.Assertions;
25 import org.junit.jupiter.api.BeforeAll;
26 import org.junit.jupiter.api.Test;
27 import org.openecomp.sdc.be.components.BeConfDependentTest;
28 import org.openecomp.sdc.be.config.ConfigurationManager;
29 import org.openecomp.sdc.common.impl.ExternalConfiguration;
30 import org.openecomp.sdc.common.impl.FSConfigurationSource;
32 class AsdcComponentsCleanerTaskTest extends BeConfDependentTest {
34 private AsdcComponentsCleanerTask createTestSubject() {
35 return new AsdcComponentsCleanerTask();
38 // TODO - remove this setup after migration to Junit5 BeConfDependentTest
40 private static void setup() {
41 configurationManager =
42 new ConfigurationManager(new FSConfigurationSource(ExternalConfiguration.getChangeListener(), "src/test/resources/config/catalog-be"));
46 void testInit() throws Exception {
47 AsdcComponentsCleanerTask testSubject;
50 testSubject = createTestSubject();
55 void testDestroy() throws Exception {
56 AsdcComponentsCleanerTask testSubject;
59 testSubject = createTestSubject();
60 testSubject.destroy();
64 void testStartTask() throws Exception {
65 AsdcComponentsCleanerTask testSubject;
68 testSubject = createTestSubject();
69 testSubject.startTask();
73 void testStopTask() throws Exception {
74 AsdcComponentsCleanerTask testSubject;
77 testSubject = createTestSubject();
79 testSubject.destroy();
83 void testRun() throws Exception {
84 AsdcComponentsCleanerTask testSubject;
87 testSubject = createTestSubject();
92 void testGetExecutorService() throws Exception {
93 AsdcComponentsCleanerTask testSubject;
94 ExecutorService result;
97 testSubject = createTestSubject();
98 result = testSubject.getExecutorService();
99 Assertions.assertNotNull(result);