If you use JMockit within WildFly, the calculation whether a MockUp target class is internal or not is not working properly.
Each MockUp you create that mocks a class that is one of your libs (not a JRE class or something that is shipped with the app-server, but shipped with your EAR) will produce the "internal class mocked" warning, even the three JMockit-internal startup mocks are affected.
e. g. the JMockit-internal startup mocks for org.junit.runner.notification.RunNotifier, org.junit.runners.BlockJUnit4ClassRunner and org.junit.runners.model.FrameworkMethod will produce the warning, because in mockit.MockUp.areClassesFromSameCodebase():260 the variable values are
You think so? Besides that the locations don't necessarily need to include the JAR name per-se, you then still cannot reliably do the validation you wanted. You can change it so that the false-positives are away, but you will probably also remove most of the real findings if you restrict the check on JAR, because target and mockup will not be in the same JAR.
Your test is also highly test-runner specific anyway. One example, I use Gradle to run normal JUnit tests with JMockit. I have multiple projects and multiple sourcesets. In the example I tested now I have a test in the test sourceset of module central-suite that creates a MockUp for a class in the shared sourceset of module central-suite. This will not trigger the warning, because of the following values:
Here you have a minimal example Gradle project where you see this: test.zip
If you unzip this and execute gradlew test -i, you will see that you get a warning for mocking main.Foo, but no warning for foo.Foo.