@Test
public void testAuthenticationSuccessful() {

  expect(mockAuthPropsConfig.isAuthSimpleEnabled()).andReturn(true);
  
  replay(mockAuthPropsConfig);
  
  Authentication authentication = new TestingAuthenticationToken("principal", "credentials");
  
  Authentication authenticationResult = provider.authenticate(authentication);
  assertEquals("principal", authenticationResult.getName());
  assertEquals("credentials", authenticationResult.getCredentials());
  assertEquals(1, authenticationResult.getAuthorities().size());
  assertEquals(new SimpleGrantedAuthority("ROLE_USER"), authenticationResult.getAuthorities().iterator().next());
  
  verify(mockAuthPropsConfig);
}