Search in sources :

Example 1 with ChangePasswordDTO

use of org.simbasecurity.core.service.manager.dto.ChangePasswordDTO in project simba-os by cegeka.

the class UserServiceTest method setup.

@Before
public void setup() {
    changePasswordDTO = new ChangePasswordDTO();
    changePasswordDTO.setUserName(userName);
    changePasswordDTO.setNewPassword(newPassword);
    changePasswordDTO.setNewPasswordConfirmation(newPasswordConfirmation);
    Session aSession = mock(Session.class);
    when(sessionRepository.findBySSOToken(ssoToken)).thenReturn(aSession);
    correspondingUser = mock(User.class);
    when(aSession.getUser()).thenReturn(correspondingUser);
    when(userRepository.findByName(userName)).thenReturn(correspondingUser);
    when(correspondingUser.getUserName()).thenReturn(userName);
    responseMock = mock(HttpServletResponse.class);
}
Also used : User(org.simbasecurity.core.domain.User) HttpServletResponse(javax.servlet.http.HttpServletResponse) ChangePasswordDTO(org.simbasecurity.core.service.manager.dto.ChangePasswordDTO) Session(org.simbasecurity.core.domain.Session) Before(org.junit.Before)

Aggregations

HttpServletResponse (javax.servlet.http.HttpServletResponse)1 Before (org.junit.Before)1 Session (org.simbasecurity.core.domain.Session)1 User (org.simbasecurity.core.domain.User)1 ChangePasswordDTO (org.simbasecurity.core.service.manager.dto.ChangePasswordDTO)1