/**
* 测试正确参数,但是返回值的属principal为空的情况。
*/
credential = Mockito.mock(Credential.class);
Authentication authentication = Mockito.mock(Authentication.class);
Mockito.when(authenticationManager.authenticate(credential)).thenReturn(authentication);
Assert.assertEquals(0, this.ki4soService.getAppList(credential).size());
/**
* 测试正确参数,但是返回值的属principal不是空的情况。
*/
credential = Mockito.mock(Credential.class);
authentication = Mockito.mock(Authentication.class);
Mockito.when(authenticationManager.authenticate(credential)).thenReturn(authentication);
Mockito.when(authentication.getPrincipal()).thenReturn(Mockito.mock(Principal.class));
List<UserLoggedStatus> list = new ArrayList<UserLoggedStatus>();
UserLoggedStatus loggedStatus = new UserLoggedStatus("test", "1001");
list.add(loggedStatus);
Mockito.when(userLoggedStatusStore.findUserLoggedStatus(Mockito.anyString())).thenReturn(list);
App app = new App();