2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Huawei Technologies Co., Ltd. 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=========================================================
20 package org.onap.so.adapters.tenant;
22 import java.util.HashMap;
24 import javax.xml.ws.Holder;
26 import org.junit.Test;
27 import org.junit.runner.RunWith;
28 import org.mockito.InjectMocks;
29 import org.mockito.Mock;
30 import org.mockito.Spy;
31 import org.mockito.runners.MockitoJUnitRunner;
32 import org.onap.so.adapters.tenantrest.TenantRollback;
33 import org.onap.so.cloud.CloudConfig;
34 import org.onap.so.entity.MsoRequest;
36 @RunWith(MockitoJUnitRunner.class)
37 public class MsoTenantAdapterImplTest {
40 private CloudConfig cloudConfig;
44 private MsoTenantAdapterImpl msoTenantAdapter;
47 public void healthCheck() throws Exception {
48 msoTenantAdapter.healthCheck();
51 @Test(expected = NullPointerException.class)
52 public void createTenant() throws Exception {
53 msoTenantAdapter.createTenant("site", "tenant", new HashMap<>(),
54 true, true, new MsoRequest(), new Holder<String>(), new Holder<TenantRollback>());
57 @Test(expected = NullPointerException.class)
58 public void queryTenant() throws Exception {
59 msoTenantAdapter.queryTenant("site", "tenant", new MsoRequest(),
60 new Holder<>(), new Holder<>(), new Holder<>());
63 @Test(expected = NullPointerException.class)
64 public void deleteTenant() throws Exception {
65 msoTenantAdapter.deleteTenant("cloud", "tenant", new MsoRequest(), new Holder<Boolean>());
69 public void rollbackTenant() throws Exception {
70 msoTenantAdapter.rollbackTenant(new TenantRollback());