diff options
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java | 174 |
1 files changed, 93 insertions, 81 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java index 88be8cbd5d..c32768b85b 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/ecomp/EcompIntImplTest.java @@ -31,91 +31,103 @@ import java.util.List; public class EcompIntImplTest { - private EcompIntImpl createTestSubject() { - return new EcompIntImpl(); - } - - @Test(expected=PortalAPIException.class) - public void testPushUser() throws Exception { - EcompIntImpl testSubject; - EcompUser user = null; - - // default test - testSubject = createTestSubject(); - testSubject.pushUser(user); - } - - @Test(expected=PortalAPIException.class) - public void testEditUser() throws Exception { - EcompIntImpl testSubject; - String loginId = ""; - EcompUser user = null; - - // default test - testSubject = createTestSubject(); - testSubject.editUser(loginId, user); - } - - @Test(expected=PortalAPIException.class) - public void testGetUser() throws Exception { - EcompIntImpl testSubject; - String loginId = ""; - EcompUser result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getUser(loginId); - } - - @Test(expected=PortalAPIException.class) - public void testGetUsers() throws Exception { - EcompIntImpl testSubject; - List<EcompUser> result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getUsers(); - } - - @Test - public void testGetAvailableRoles() throws Exception { - EcompIntImpl testSubject; - List<EcompRole> result; - - // default test - testSubject = createTestSubject(); + private EcompIntImpl createTestSubject() { + return new EcompIntImpl(); + } + + @Test(expected=PortalAPIException.class) + public void testPushUser() throws Exception { + EcompIntImpl testSubject; + EcompUser user = null; + + // default test + testSubject = createTestSubject(); + testSubject.pushUser(user); + } + + @Test(expected=PortalAPIException.class) + public void testEditUser() throws Exception { + EcompIntImpl testSubject; + String loginId = ""; + EcompUser user = null; + + // default test + testSubject = createTestSubject(); + testSubject.editUser(loginId, user); + } + + @Test(expected=PortalAPIException.class) + public void testGetUser() throws Exception { + EcompIntImpl testSubject; + String loginId = ""; + EcompUser result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUser(loginId); + } + + @Test(expected=PortalAPIException.class) + public void testGetUsers() throws Exception { + EcompIntImpl testSubject; + List<EcompUser> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUsers(); + } + + @Test + public void testGetAvailableRoles() throws Exception { + EcompIntImpl testSubject; + List<EcompRole> result; + + // default test + testSubject = createTestSubject(); result = testSubject.getAvailableRoles("Mock"); - } + } + + /*@Test + public void testPushUserRole() throws Exception { + EcompIntImpl testSubject; + String loginId = ""; + List<EcompRole> roles = null; + + // test 1 + testSubject = createTestSubject(); + roles = null; + testSubject.pushUserRole(loginId, roles); + }*/ @Test(expected= PortalAPIException.class) - public void testGetUserRoles() throws Exception { - EcompIntImpl testSubject; - String loginId = ""; - List<EcompRole> result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getUserRoles(loginId); - } - - @Test - public void testIsAppAuthenticated() throws Exception { - EcompIntImpl testSubject; - boolean result; + public void testGetUserRoles() throws Exception { + EcompIntImpl testSubject; + String loginId = ""; + List<EcompRole> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUserRoles(loginId); + } + + @Test + public void testIsAppAuthenticated() throws Exception { + EcompIntImpl testSubject; + boolean result; HttpServletRequest httpServletRequestImpl = Mockito.mock(HttpServletRequest.class); - // default test - testSubject = createTestSubject(); - result = testSubject.isAppAuthenticated(httpServletRequestImpl); - } - - @Test - public void testGetUserId() throws Exception { - EcompIntImpl testSubject; + // default test + testSubject = createTestSubject(); + result = testSubject.isAppAuthenticated(httpServletRequestImpl); + } + + @Test + public void testGetUserId() throws Exception { + EcompIntImpl testSubject; HttpServletRequest httpServletRequestImpl = Mockito.mock(HttpServletRequest.class); - String result; + String result; - // default test - testSubject = createTestSubject(); - result = testSubject.getUserId(httpServletRequestImpl); - } + // default test + testSubject = createTestSubject(); + result = testSubject.getUserId(httpServletRequestImpl); + } } |