Jonathan S. Fisher
Jonathan S. Fisher

Reputation: 8886

With Java 17, JUnit5, is there a way to always launch a test with a Java Agent?

We need to make sure we always launch several Java JUnit5 tests with EclipseLink as a Java Agent. This is because these test will do some JPA dynamic queries and EclipseLink needs to do some class weaving in order to function.

In Maven, we fixed this by by supplying argLine to the surefire and failsafe plugins pointing at the EclipseLink jar.

However, it's royal pain the butt for running the tests out of the IDE... where you have to setup a profile for each test to launch with the agent in tow.

I'm hoping there's a simple annotation that we can annotate our tests with to do this, but I've come up empty in my search. Thank you for any help, or any pointers were someone has at least done something similar where we could modify their approach to work for us.

Upvotes: 0

Views: 253

Answers (0)

Related Questions