arextest / arex-agent-java

Lightweight Java agent for traffic capture and replay, enhancing testing and debugging.
https://doc.arextest.com/
Apache License 2.0
416 stars 83 forks source link

[Bug] 对自定义注解进行了动态类配置,mock匹配时没有匹配到方法层,导致匹配错误产生对象转换失败异常 #456

Closed zengyixun closed 2 months ago

zengyixun commented 2 months ago

Search before asking

AREX Test Service

AREX Java Agent (arextest/arex-agent-java)

Current Behavior

对象转换失败异常

Expected Behavior

匹配对象准确,返回的对象正确,不会导致转换异常

Steps To Reproduce

  1. 自定义一个注解
  2. 在多个不同返回对象的get方法上加上这个注解,方法名不同,但参数类型相同
  3. 设置这个注解的实现方法为动态类。
  4. 修改代码让调用乱序,在修改后的代码上回放

Anything else

No response

Are you willing to submit a pull request to fix on your own?

lucas-myx commented 2 months ago

because project used spring aop annotation: @Around ProceedingJoinPoint, arex-agent needs to record the request parameters of the actually method decorated by ProcessingJoinPoint in order to replay correctly.

YongwuHe commented 2 months ago

已解决。 PR: https://github.com/arextest/arex-agent-java/pull/459