I'm trying to write a unit test to validate my resilience4j app with the @retry annotation, but it's not retrying at all. The code works when I run it, just can't get it unit tested.. Any ideas?
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {ClassImTesting.class})
public class MyCoolTest {
@Autowired
private MyClass thing;
@Test
public void myTest() throws TransformationException {
thing.transform(null);
}
ClassImTesting
@Override
@Retry(name = "transformer", fallbackMethod = "handleFailure")
public void transform(Thing record)
throws TransformationException {
return this.transform(record.value());
}
public void handleFailure(Thing record, Throwable t) {
// stuff
}