threads.add(t);
}
String username = TestConfiguration.d1principal.split("\\\\")[1];
AuthenticationResponse response = am.authenticate(
new SimpleAuthenticationIdentity(username));
// we will expect to find exactly the same number of groups during crawl
int constGroups = response.getGroups().size();
boolean finished = false;
// Run Authentication every 200ms and measure if it was faster than 3 sec
while (!finished) {
Thread.sleep(200);
long start = System.currentTimeMillis();
response = am.authenticate(
new SimpleAuthenticationIdentity(username));
long diff = System.currentTimeMillis() - start;
assertTrue("Less than three seconds [" + diff + "]" , diff < 3000);
assertTrue("Principal valid: " + TestConfiguration.d1principal,
response.isValid());
int groups = response.getGroups().size();