@Test
public void testNonBlockingCommandQueueFiresTimeout() throws Exception { //see https://github.com/Netflix/Hystrix/issues/514

    final TestHystrixCommand<Integer> cmd = getCommand(ExecutionIsolationStrategy.THREAD, AbstractTestHystrixCommand.ExecutionResult.SUCCESS, 200, AbstractTestHystrixCommand.FallbackResult.SUCCESS, 50);
    new Thread() {
        @Override
        public void run() {
            cmd.queue();
        }
    }.start();
    Thread.sleep(200);
    //timeout should occur in 50ms, and underlying thread should run for 500ms
    //therefore, after 200ms, the command should have finished with a fallback on timeout
    assertTrue(cmd.isExecutionComplete());
    assertTrue(cmd.isResponseTimedOut());
    assertEquals(0, cmd.metrics.getCurrentConcurrentExecutionCount());
}