diff options
author | 2018-09-25 13:59:56 -0400 | |
---|---|---|
committer | 2018-09-26 16:52:00 -0400 | |
commit | a59bc3e85eaf33c0a38063e5c30fe890588a0eb1 (patch) | |
tree | b19ba17d5dbd6cecc0b34c0ef6b158c088746384 /ecomp-portal-BE-os/src/test/java/org/onap | |
parent | 4be6886a011ddbc4543e8c27b759a27ff3415c18 (diff) |
login and Certman AAF Integration changes
Issue-ID: PORTAL-386, PORTAL-389
failed to create user with special char in login_id
Change-Id: I415adf615a7af97319d8d11a740e75d3dfa11583
Signed-off-by: Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
Diffstat (limited to 'ecomp-portal-BE-os/src/test/java/org/onap')
-rw-r--r-- | ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java index 6b24e96d..04234059 100644 --- a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed @@ -37,7 +37,8 @@ */ package org.onap.portalapp.portal.service; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import java.util.ArrayList; import java.util.List; @@ -55,8 +56,6 @@ import org.mockito.MockitoAnnotations; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.framework.MockEPUser; import org.onap.portalapp.portal.framework.MockitoTestSuite; -import org.onap.portalapp.portal.service.SearchServiceImpl; -import org.onap.portalapp.portal.service.UserService; import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle; import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.powermock.api.mockito.PowerMockito; @@ -105,19 +104,18 @@ public class SearchServiceImplTest { PowerMockito.mockStatic(EcompPortalUtils.class); List<String> list = new ArrayList<>(); String str = "Test"; - String str2 = "Test new"; - String str1 = "Test new1"; + String str1 = "Testnew"; list.add(str); list.add(str1); - list.add(str2); - Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test", " ")).thenReturn(list); + Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test Testnew", " ")).thenReturn(list); + @SuppressWarnings({ "unchecked", "rawtypes" }) List<EPUser> userList = new ArrayList(); EPUser user = mockUser.mockEPUser(); - user.setLastName("Test new"); + user.setLastName("Testnew"); userList.add(user); - Mockito.when( this.userService.getUserByFirstLastName("Test","Test new")).thenReturn(userList); - String result = searchServiceImpl.searchUsersInPhoneBook("Test"); - assertEquals("[{\"orgUserId\":\"guestT\",\"firstName\":\"test\",\"lastName\":\"Test new\",\"jobTitle\":null}]" , result); + Mockito.when( this.userService.getUserByFirstLastName("Test","Testnew")).thenReturn(userList); + String result = searchServiceImpl.searchUsersInPhoneBook("Test Testnew"); + assertEquals("[{\"orgUserId\":\"guestT\",\"firstName\":\"test\",\"lastName\":\"Testnew\",\"jobTitle\":null}]" , result); } |