I have a method which I'm trying to test
@Retryable(value = {SocketTimeoutException.class},
backoff = @Backoff(delay = 10000),
maxAttempts = 4)
public String getNewString(String oldString) throws IOException{
...
}
I have created it's test case like so:
@SpringBootTest
@RunWith(SpringRunner.class)
public class TestStrings {
@Test(expected = SocketTimeoutException.class)
public void testGetNewString() throws IOException {
...
}
Everything works great, the test case runs 4 times with a delay of 10sec. But I want to change the attributes of @Retryable, namely maxAttempts from 4 to 2 and delay from 10s to 0.5s for this specific test case. I want to do this so that when running the test cases it should not wait for a long time and the test case should end quickly meanwhile also testing the retry functionality.