Increase unit test coverage for backend
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / config / CatalogBESpringConfigTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 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  * Modifications copyright (c) 2019 Nokia
20  * ================================================================================
21  */
22
23 package org.openecomp.sdc.config;
24
25 import static org.mockito.Mockito.mock;
26
27 import org.apache.http.impl.client.CloseableHttpClient;
28 import org.junit.Test;
29 import org.onap.sdc.security.PortalClient;
30 import org.openecomp.sdc.be.auditing.impl.ConfigurationProvider;
31 import org.openecomp.sdc.be.components.impl.ComponentLocker;
32 import org.openecomp.sdc.be.components.impl.lock.ComponentLockAspect;
33 import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic;
34 import org.openecomp.sdc.be.dao.janusgraph.JanusGraphClient;
35 import org.openecomp.sdc.be.dao.janusgraph.JanusGraphDao;
36 import org.openecomp.sdc.be.ecomp.converters.AssetMetadataConverter;
37 import org.openecomp.sdc.be.filters.PortalConfiguration;
38 import org.openecomp.sdc.be.filters.ThreadLocalUtils;
39 import org.openecomp.sdc.be.tosca.CommonCsarGenerator;
40 import org.openecomp.sdc.be.tosca.DefaultCsarGenerator;
41
42 public class CatalogBESpringConfigTest {
43
44     private CatalogBESpringConfig createTestSubject() {
45         return new CatalogBESpringConfig(mock(ComponentLocker.class));
46     }
47
48     @Test
49     public void testLifecycleBusinessLogic() throws Exception {
50         CatalogBESpringConfig testSubject;
51         LifecycleBusinessLogic result;
52
53         // default test
54         testSubject = createTestSubject();
55         result = testSubject.lifecycleBusinessLogic();
56     }
57
58     @Test
59     public void testConfigurationProvider() throws Exception {
60         CatalogBESpringConfig testSubject;
61         ConfigurationProvider result;
62
63         // default test
64         testSubject = createTestSubject();
65         result = testSubject.configurationProvider();
66     }
67
68     @Test
69     public void testAssetMetadataConverter() throws Exception {
70         CatalogBESpringConfig testSubject;
71         AssetMetadataConverter result;
72
73         // default test
74         testSubject = createTestSubject();
75         result = testSubject.assetMetadataConverter();
76     }
77
78     @Test
79     public void testComponentLockAspect() throws Exception {
80         CatalogBESpringConfig testSubject;
81         ComponentLockAspect result;
82
83         // default test
84         testSubject = createTestSubject();
85         result = testSubject.componentLockAspect();
86     }
87
88     @Test
89     public void testHttpClientConnectionManager() throws Exception {
90         CatalogBESpringConfig testSubject;
91         CloseableHttpClient result;
92
93         // default test
94         testSubject = createTestSubject();
95         result = testSubject.httpClientConnectionManager();
96     }
97
98     @Test
99     public void testPortalConfiguration() throws Exception {
100         CatalogBESpringConfig testSubject;
101         PortalConfiguration result;
102
103         // default test
104         testSubject = createTestSubject();
105         result = testSubject.portalConfiguration();
106     }
107
108     @Test
109     public void testThreadLocalUtils() throws Exception {
110         CatalogBESpringConfig testSubject;
111         ThreadLocalUtils result;
112
113         // default test
114         testSubject = createTestSubject();
115         result = testSubject.threadLocalUtils();
116     }
117
118     @Test
119     public void testPortalClient() throws Exception {
120         CatalogBESpringConfig testSubject;
121         PortalClient result;
122
123         // default test
124         testSubject = createTestSubject();
125         result = testSubject.portalClient();
126     }
127
128 }