Disabling certain aspects during unit test runs

前端 未结 4 2099
我在风中等你
我在风中等你 2021-01-04 01:21

I have integration tests (load context) and unit tests running together. My code does aspectj compile time weaving using spring.

My problem is that my declared advi

4条回答
  •  暖寄归人
    2021-01-04 01:56

    Compile time weaving would inline the advice calls in the targeted methods identified by the pointcuts that you have. I personally feel that it is good to unit test with the compile time weaving in place, because at runtime your unit does include the class with the advice inlined?

    The thought I have to not include advice would be to have two different compile targets, one with compile time weaving, and one without, you should be able to do this through maven profiles, a dev profile not weaving advice in and a prod profile to weave the aspects in.

提交回复
热议问题