Record method calls in one session for replaying in future test sessions?

前端 未结 9 1297
梦毁少年i
梦毁少年i 2020-12-23 14:21

I have a backend system which we use a third-party Java API to access from our own applications. I can access the system as a normal user along with other users, but I do no

9条回答
  •  旧巷少年郎
    2020-12-23 14:48

    This can be done with AOP, aspect oriented programming. It allows to intercept method calls by byte code manipulation. Do a bit of search for examples.

    In one case this can do recording, in the other replaying.

    Pointers: wikipedia, AspectJ, Spring AOP.

    Unfortunately one moves a bit outside the java syntax, and a simple example can better be sought elsewhere. With explanation.

    Maybe combined with unit tests / some mocking test framework for offline testing with recorded data.

提交回复
热议问题