@Test
public void testFileAuthenticates() {

  Authentication authentication = new TestingAuthenticationToken("principal", "credentials");
  expect(mockLdapProvider.authenticate(authentication)).andReturn(FAILED_AUTHENTICATION);
  expect(mockFileProvider.authenticate(authentication)).andReturn(SUCCESSFUL_AUTHENTICATION);
  
  replay(mockLdapProvider, mockFileProvider, mockSimpleProvider, mockExternalServerProvider);
  
  Authentication authenticationResult = provider.authenticate(authentication);
  assertSame(authenticationResult, SUCCESSFUL_AUTHENTICATION);
  
  verify(mockLdapProvider, mockFileProvider, mockSimpleProvider, mockExternalServerProvider);
}