Unable to do unit testing of retry parameter of AmazonS3Client

Viewed 331

I have build a nifi custom processor.to put a object in AWS s3 bucket.(used AmazonS3Client in AWS SDK) In the ClientConfig , i have chnaged the MaxErrorRetry to 4(default AWS gives 3).

testcase Scenario: I want do a unit testing(using Junit, Mokito) , to test this chnaged retry parameter is working or not.

Means, If i am getting 5**(Errror from server side) error then it will again attemp to upload the file to s3 and it will continue to try 4 times as my configured paramater whihc is 4 times.

I also want another clarification , while uploading the file s3 bucket, if i am giving wrong bucketname(errror related to client side 4**), then it will rerty 4 times or not.

Thanks in advance for help

@Test
    public void testRetryLogin() {
        final TestRunner runner = TestRunners.newTestRunner(new myprocessor);


// need the logiv`enter code here`
        runner.run();
       // will do assert

    }
0 Answers
Related