无法在 Springboot 单元测试中获取弹性 4j 重试注释以执行

问题描述

我正在尝试编写单元测试以使用 @retry 注释验证我的弹性 4j 应用程序,但它根本没有重试。代码在我运行时有效,只是无法对其进行单元测试.. 有什么想法吗?

@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
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)