}
@Test
public void testGet500WithError1040() {
AtmosUtils utils = createMock(AtmosUtils.class);
BackoffLimitedRetryHandler backoffLimitedRetryHandler = createMock(BackoffLimitedRetryHandler.class);
HttpCommand command = createMock(HttpCommand.class);
String content = String.format(HTTP_MESSAGE_FORMAT, 1040, "The server is busy. Please try again");
HttpResponse response = HttpResponse.builder().statusCode(500).payload(content).build();
expect(command.getFailureCount()).andReturn(0).once();
expect(utils.parseAtmosErrorFromContent(command, response, content)).andReturn(new AtmosError(1040, "The server is busy. Please try again")).once();
expect(backoffLimitedRetryHandler.shouldRetryRequest(command, response)).andReturn(true).once();
replay(utils, backoffLimitedRetryHandler, command);
AtmosServerErrorRetryHandler retry = new AtmosServerErrorRetryHandler(backoffLimitedRetryHandler, utils);