How can I force pit to use a particular junit version

113 Views Asked by At

I am using pit 1.6.7 and I want to use JUnit 4.12, but it looks like pit is always using junit 3.8.1 even junit 4.12 is in the dependency.

How can I force PIT to use junit 4.12 in the maven pom file.

1

There are 1 best solutions below

1
On

PIT will use the version of junit used by the code under test. Why do you believe it is using 3.8.1?

Your pom declares a non standard fork of junit "4.12-soneya" as a depedency. I can see no reason why this should not work, but you may wish to try using standard junit 4.12 and see if that resolved correctly for you first.

Unrelated to your question, unless you have a good reason for doing so you should not enable ALL mutators, stick with the defaults or STRONGER. You will also have a better experience if you use the latest version of pitest (1.7.1).