2 * Copyright (C) 2020 CMCC, Inc. and others. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 package org.openecomp.sdc.be.components.impl;
21 import org.junit.jupiter.api.BeforeEach;
22 import org.junit.jupiter.api.Test;
23 import org.junit.jupiter.api.extension.ExtendWith;
24 import org.mockito.InjectMocks;
25 import org.mockito.Mockito;
26 import org.mockito.junit.jupiter.MockitoExtension;
27 import org.openecomp.sdc.be.model.Service;
28 import org.openecomp.sdc.be.model.UploadServiceInfo;
30 import static org.junit.jupiter.api.Assertions.assertNotNull;
31 import static org.junit.jupiter.api.Assertions.assertNull;
33 @ExtendWith(MockitoExtension.class)
34 class ServiceImportManagerTest {
37 private ServiceImportManager serviceImportManager;
39 public static final ServiceBusinessLogic serviceBusinessLogic = Mockito.mock(ServiceBusinessLogic.class);
43 serviceImportManager = new ServiceImportManager();
46 private ServiceImportManager createTestSubject() {
47 return new ServiceImportManager();
51 void testGetServiceImportBusinessLogic() {
52 ServiceImportManager testSubject;
53 ServiceImportBusinessLogic result;
55 testSubject = createTestSubject();
56 result = testSubject.getServiceImportBusinessLogic();
61 void testSetServiceImportBusinessLogic() {
62 ServiceImportManager testSubject;
63 ServiceImportBusinessLogic serviceImportBusinessLogic = null;
65 testSubject = createTestSubject();
66 testSubject.setServiceImportBusinessLogic(serviceImportBusinessLogic);
67 assertNotNull(testSubject);
71 void testGetServiceBusinessLogic() {
72 ServiceImportManager testSubject;
73 ServiceBusinessLogic result;
75 testSubject = createTestSubject();
76 result = testSubject.getServiceBusinessLogic();
81 void testSetServiceBusinessLogic() {
82 ServiceImportManager testSubject;
83 ServiceBusinessLogic serviceBusinessLogic = null;
85 testSubject = createTestSubject();
86 testSubject.setServiceBusinessLogic(serviceBusinessLogic);
87 assertNotNull(testSubject);
91 void testPopulateServiceMetadata() {
92 UploadServiceInfo serviceMetaData = new UploadServiceInfo();
93 serviceMetaData.setDescription("Description");
94 serviceMetaData.setVendorName("VendorName");
95 serviceMetaData.setVendorRelease("VendorRelease");
96 Service service = new Service();
97 service.setName("service");
98 serviceImportManager.populateServiceMetadata(serviceMetaData, service);