How can I find out if code is running inside a JUnit test or not?

前端 未结 11 1295
梦毁少年i
梦毁少年i 2020-12-24 10:34

In my code I need to do certain fixes only when it is run inside a JUnit test. How can I find out if code is running inside a JUnit test or not? Is there something like JUni

11条回答
  •  旧巷少年郎
    2020-12-24 10:54

    In order to distinguish between test and no test you can always define special property or value in application-test.properties.

提交回复
热议问题