@Test
public void testAuthenticationEmptyPassword() {

  expect(mockAuthPropsConfig.isAuthExternalEnabled()).andReturn(true);
  
  replay(mockAuthPropsConfig);
  
  Authentication authentication = new TestingAuthenticationToken("principal", "");
  
  try {
    provider.authenticate(authentication);
    assertTrue("Should have thrown BadCredentialsException", false);
  } catch(BadCredentialsException e) {
    assertEquals("Password can't be null or empty.", e.getMessage());
  }
  
  verify(mockAuthPropsConfig);
}