@Test
public void testValidUserWithNullPassword() {

    Mockito.when(mockUserService.containsName(USERNAME)).thenReturn(true);
    final LoginRequest loginRequest = new LoginRequest();
    loginRequest.setName(USERNAME);
    loginRequest.setPassword(null);
    boolean exceptionThrown = false;
    try {
        userController.login(loginRequest);
    } catch (final InvalidLoginException e) {
        exceptionThrown = true;
    }
    assertTrue(exceptionThrown);
    Mockito.verify(mockUserService).containsName(USERNAME);
}