@Test
public void testRetryDisabledAfterServiceUnavailable() {

    // Create environment that disables retry logic with 503
    DXEnvironment env = DXEnvironment.Builder.fromDefaults().disableRetry().build();
    // Check that retry really is disabled
    Assert.assertTrue(env.isRetryDisabled());
    boolean thrown = false;
    long startTime = System.currentTimeMillis();
    long serverTime = getServerTime();
    try {
        new DXHTTPRequest(env).request("/system/comeBackLater",
                mapper.valueToTree(new ComeBackLaterRequest(serverTime + 8000)),
                RetryStrategy.SAFE_TO_RETRY);
    } catch (ServiceUnavailableException e) {
        thrown = true;
        long timeElapsed = System.currentTimeMillis() - startTime;
        Assert.assertTrue(timeElapsed < 2500);
    }
    Assert.assertTrue(thrown);
}