Catalog alignment
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / ecomp / EcompIntImplTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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  */
20
21 package org.openecomp.sdc.be.ecomp;
22
23 import org.junit.Test;
24 import org.mockito.Mockito;
25 import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
26 import org.onap.portalsdk.core.restful.domain.EcompRole;
27 import org.onap.portalsdk.core.restful.domain.EcompUser;
28
29 import javax.servlet.http.HttpServletRequest;
30 import java.util.List;
31
32 public class EcompIntImplTest {
33
34         private EcompIntImpl createTestSubject() {
35                 return new EcompIntImpl();
36         }
37
38         @Test(expected=PortalAPIException.class)
39         public void testPushUser() throws Exception {
40                 EcompIntImpl testSubject;
41                 EcompUser user = null;
42
43                 // default test
44                 testSubject = createTestSubject();
45                 testSubject.pushUser(user);
46         }
47
48         @Test(expected=PortalAPIException.class)
49         public void testEditUser() throws Exception {
50                 EcompIntImpl testSubject;
51                 String loginId = "";
52                 EcompUser user = null;
53
54                 // default test
55                 testSubject = createTestSubject();
56                 testSubject.editUser(loginId, user);
57         }
58
59         @Test(expected=PortalAPIException.class)
60         public void testGetUser() throws Exception {
61                 EcompIntImpl testSubject;
62                 String loginId = "";
63                 EcompUser result;
64
65                 // default test
66                 testSubject = createTestSubject();
67                 result = testSubject.getUser(loginId);
68         }
69
70         @Test(expected=PortalAPIException.class)
71         public void testGetUsers() throws Exception {
72                 EcompIntImpl testSubject;
73                 List<EcompUser> result;
74
75                 // default test
76                 testSubject = createTestSubject();
77                 result = testSubject.getUsers();
78         }
79
80         @Test
81         public void testGetAvailableRoles() throws Exception {
82                 EcompIntImpl testSubject;
83                 List<EcompRole> result;
84
85                 // default test
86                 testSubject = createTestSubject();
87         result = testSubject.getAvailableRoles("Mock");
88         }
89
90         /*@Test
91         public void testPushUserRole() throws Exception {
92                 EcompIntImpl testSubject;
93                 String loginId = "";
94                 List<EcompRole> roles = null;
95
96                 // test 1
97                 testSubject = createTestSubject();
98                 roles = null;
99                 testSubject.pushUserRole(loginId, roles);
100         }*/
101
102     @Test(expected= PortalAPIException.class)
103         public void testGetUserRoles() throws Exception {
104                 EcompIntImpl testSubject;
105                 String loginId = "";
106                 List<EcompRole> result;
107
108                 // default test
109                 testSubject = createTestSubject();
110                 result = testSubject.getUserRoles(loginId);
111         }
112
113         @Test
114         public void testIsAppAuthenticated() throws Exception {
115                 EcompIntImpl testSubject;
116                 boolean result;
117         HttpServletRequest httpServletRequestImpl = Mockito.mock(HttpServletRequest.class);
118                 // default test
119                 testSubject = createTestSubject();
120                 result = testSubject.isAppAuthenticated(httpServletRequestImpl);
121         }
122
123         @Test
124         public void testGetUserId() throws Exception {
125                 EcompIntImpl testSubject;
126         HttpServletRequest httpServletRequestImpl = Mockito.mock(HttpServletRequest.class);
127                 String result;
128
129                 // default test
130                 testSubject = createTestSubject();
131                 result = testSubject.getUserId(httpServletRequestImpl);
132         }
133 }