Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-openstack-adapters / src / test / java / org / onap / so / adapters / tenant / MsoTenantAdapterImplTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
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 package org.onap.so.adapters.tenant;
21
22 import java.util.HashMap;
23 import javax.xml.ws.Holder;
24 import org.junit.Test;
25 import org.junit.runner.RunWith;
26 import org.mockito.InjectMocks;
27 import org.mockito.Mock;
28 import org.mockito.Spy;
29 import org.mockito.junit.MockitoJUnitRunner;
30 import org.onap.so.adapters.tenantrest.TenantRollback;
31 import org.onap.so.cloud.CloudConfig;
32 import org.onap.so.entity.MsoRequest;
33
34 @RunWith(MockitoJUnitRunner.class)
35 public class MsoTenantAdapterImplTest {
36
37     @Mock
38     private CloudConfig cloudConfig;
39
40     @Spy
41     @InjectMocks
42     private MsoTenantAdapterImpl msoTenantAdapter;
43
44     @Test
45     public void healthCheck() throws Exception {
46         msoTenantAdapter.healthCheck();
47     }
48
49     @Test(expected = NullPointerException.class)
50     public void createTenant() throws Exception {
51         msoTenantAdapter.createTenant("site", "tenant", new HashMap<>(), true, true, new MsoRequest(),
52                 new Holder<String>(), new Holder<TenantRollback>());
53     }
54
55     @Test(expected = NullPointerException.class)
56     public void queryTenant() throws Exception {
57         msoTenantAdapter.queryTenant("site", "tenant", new MsoRequest(), new Holder<>(), new Holder<>(),
58                 new Holder<>());
59     }
60
61     @Test(expected = NullPointerException.class)
62     public void deleteTenant() throws Exception {
63         msoTenantAdapter.deleteTenant("cloud", "tenant", new MsoRequest(), new Holder<Boolean>());
64     }
65
66     @Test
67     public void rollbackTenant() throws Exception {
68         msoTenantAdapter.rollbackTenant(new TenantRollback());
69     }
70
71 }