> + 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); > + > + assertTrue(retry.shouldRetryRequest(command, response)); > + > + verify(utils, backoffLimitedRetryHandler, command); > + }
Do we also need tests here for non-1040 error code and for `null` content? --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/285/files#r9651227