}
}
@Test
public void shouldLogWhenExceptionIsThrown() throws AuthenticationException {
final DefaultExceptionLogger defaultExceptionLogger = spy(new DefaultExceptionLogger());
HystrixPlugins.getInstance().registerCommandExecutionHook(new ExceptionLoggingCommandHook(defaultExceptionLogger));
when(mockAuthenticator.authenticate(any(String.class))).thenThrow(new AuthenticationException("test"));
doCallRealMethod().when(defaultExceptionLogger).log(any(Exception.class), any(HystrixCommand.class));
try {