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 static org.junit.jupiter.api.Assertions.assertNotNull;
22 import static org.junit.jupiter.api.Assertions.assertNull;
24 import org.junit.jupiter.api.BeforeEach;
25 import org.junit.jupiter.api.Test;
26 import org.junit.jupiter.api.extension.ExtendWith;
27 import org.mockito.InjectMocks;
28 import org.mockito.Mockito;
29 import org.mockito.junit.jupiter.MockitoExtension;
30 import org.openecomp.sdc.be.model.Service;
31 import org.openecomp.sdc.be.model.UploadServiceInfo;
33 @ExtendWith(MockitoExtension.class)
34 class ServiceImportManagerTest {
36 private final ServiceBusinessLogic serviceBusinessLogic = Mockito.mock(ServiceBusinessLogic.class);
38 private ServiceImportManager serviceImportManager;
42 serviceImportManager = new ServiceImportManager();
45 private ServiceImportManager createTestSubject() {
46 return new ServiceImportManager();
50 void testGetServiceImportBusinessLogic() {
51 ServiceImportManager testSubject;
52 ServiceImportBusinessLogic result;
54 testSubject = createTestSubject();
55 result = testSubject.getServiceImportBusinessLogic();
60 void testSetServiceImportBusinessLogic() {
61 ServiceImportManager testSubject;
62 ServiceImportBusinessLogic serviceImportBusinessLogic = null;
64 testSubject = createTestSubject();
65 testSubject.setServiceImportBusinessLogic(serviceImportBusinessLogic);
66 assertNotNull(testSubject);
70 void testGetServiceBusinessLogic() {
71 ServiceImportManager testSubject;
72 ServiceBusinessLogic result;
74 testSubject = createTestSubject();
75 result = testSubject.getServiceBusinessLogic();
80 void testSetServiceBusinessLogic() {
81 ServiceImportManager testSubject;
82 ServiceBusinessLogic serviceBusinessLogic = null;
84 testSubject = createTestSubject();
85 testSubject.setServiceBusinessLogic(serviceBusinessLogic);
86 assertNotNull(testSubject);
90 void testPopulateServiceMetadata() {
91 UploadServiceInfo serviceMetaData = new UploadServiceInfo();
92 serviceMetaData.setDescription("Description");
93 serviceMetaData.setVendorName("VendorName");
94 serviceMetaData.setVendorRelease("VendorRelease");
95 Service service = new Service();
96 service.setName("service");
97 serviceImportManager.populateServiceMetadata(serviceMetaData, service);