@Test
public void testRejectedThreadWithNoFallback() throws Exception {

    HystrixCommandKey key = HystrixCommandKey.Factory.asKey("Rejection-NoFallback");
    TestCircuitBreaker circuitBreaker = new TestCircuitBreaker();
    SingleThreadedPoolWithQueue pool = new SingleThreadedPoolWithQueue(1);
    // fill up the queue
    pool.queue.add(new Runnable() {
        @Override
        public void run() {
            System.out.println("**** queue filler1 ****");
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    });
    Future<Boolean> f = null;
    TestCommandRejection command1 = null;
    TestCommandRejection command2 = null;
    try {
        command1 = new TestCommandRejection(key, circuitBreaker, pool, 500, 600, TestCommandRejection.FALLBACK_NOT_IMPLEMENTED);
        f = command1.queue();
        command2 = new TestCommandRejection(key, circuitBreaker, pool, 500, 600, TestCommandRejection.FALLBACK_NOT_IMPLEMENTED);
        command2.queue();
        fail("we shouldn't get here");
    } catch (Exception e) {
        e.printStackTrace();
        System.out.println("command.getExecutionTimeInMilliseconds(): " + command2.getExecutionTimeInMilliseconds());
        // will be -1 because it never attempted execution
        assertTrue(command2.isResponseRejected());
        assertFalse(command2.isResponseShortCircuited());
        assertFalse(command2.isResponseTimedOut());
        assertNotNull(command2.getExecutionException());
        if (e instanceof HystrixRuntimeException && e.getCause() instanceof RejectedExecutionException) {
            HystrixRuntimeException de = (HystrixRuntimeException) e;
            assertNotNull(de.getFallbackException());
            assertTrue(de.getFallbackException() instanceof UnsupportedOperationException);
            assertNotNull(de.getImplementingClass());
            assertNotNull(de.getCause());
            assertTrue(de.getCause() instanceof RejectedExecutionException);
        } else {
            fail("the exception should be HystrixRuntimeException with cause as RejectedExecutionException");
        }
    }
    f.get();
    assertCommandExecutionEvents(command1, HystrixEventType.SUCCESS);
    assertCommandExecutionEvents(command2, HystrixEventType.THREAD_POOL_REJECTED, HystrixEventType.FALLBACK_MISSING);
    assertEquals(0, circuitBreaker.metrics.getCurrentConcurrentExecutionCount());
    assertSaneHystrixRequestLog(2);
}