From a59bc3e85eaf33c0a38063e5c30fe890588a0eb1 Mon Sep 17 00:00:00 2001 From: "Kishore Reddy, Gujja (kg811t)" Date: Tue, 25 Sep 2018 13:59:56 -0400 Subject: 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) --- .../portal/service/SearchServiceImplTest.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'ecomp-portal-BE-os/src/test/java/org') 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 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 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); } -- cgit 1.2.3-korg