@Test
public void testLoginWithUnexpectedException() {

    createSubjectThrowingExceptionAndBindItToThread(IllegalArgumentException.class);
    LoginCredentials credentials = new LoginCredentials("jad", "wrong");
    // Create mock OSGi services to inject
    MockLogService logservice = new MockLogService();
    // Create the servlet and do the login
    Login resource = new Login();
    resource.logservice = logservice;
    assertThrows(InternalServerErrorException.class, () -> {
            resource.doLogin(credentials);
        });
}