6d51c4dc0f36fa15f7f9647d4380804ae70ac26e
[sdc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.openecomp.sdc.be.components.scheduledtasks;
22
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;
31
32 class AsdcComponentsCleanerTaskTest extends BeConfDependentTest {
33
34     private AsdcComponentsCleanerTask createTestSubject() {
35         return new AsdcComponentsCleanerTask();
36     }
37
38     // TODO - remove this setup after migration to Junit5 BeConfDependentTest
39     @BeforeAll
40     private static void setup() {
41         configurationManager =
42             new ConfigurationManager(new FSConfigurationSource(ExternalConfiguration.getChangeListener(), "src/test/resources/config/catalog-be"));
43     }
44
45     @Test
46     void testInit() throws Exception {
47         AsdcComponentsCleanerTask testSubject;
48
49         // default test
50         testSubject = createTestSubject();
51         testSubject.init();
52     }
53
54     @Test
55     void testDestroy() throws Exception {
56         AsdcComponentsCleanerTask testSubject;
57
58         // default test
59         testSubject = createTestSubject();
60         testSubject.destroy();
61     }
62
63     @Test
64     void testStartTask() throws Exception {
65         AsdcComponentsCleanerTask testSubject;
66
67         // default test
68         testSubject = createTestSubject();
69         testSubject.startTask();
70     }
71
72     @Test
73     void testStopTask() throws Exception {
74         AsdcComponentsCleanerTask testSubject;
75
76         // default test
77         testSubject = createTestSubject();
78         testSubject.init();
79         testSubject.destroy();
80     }
81
82     @Test
83     void testRun() throws Exception {
84         AsdcComponentsCleanerTask testSubject;
85
86         // default test
87         testSubject = createTestSubject();
88         testSubject.run();
89     }
90
91     @Test
92     void testGetExecutorService() throws Exception {
93         AsdcComponentsCleanerTask testSubject;
94         ExecutorService result;
95
96         // default test
97         testSubject = createTestSubject();
98         result = testSubject.getExecutorService();
99         Assertions.assertNotNull(result);
100     }
101 }