pitest icon indicating copy to clipboard operation
pitest copied to clipboard

`avoidCallsTo` not working for internal classes

Open daniel-frak opened this issue 11 months ago • 0 comments

Assuming I have a class structure like this:

public class MyClass {

  public someMethod1() {
    MyInternalClass.someMethod2();
  }

  private static class MyInternalClass {

    static void someMethod2() {
      // Do stuff
    }
  }
}

Then adding com.example.MyClass.MyInternalClass to avoidCallsTo should (I assume) prevent the MyInternalClass.someMethod2(); from being mutated, which is not what happens.

Granted, this is not a common setup but it currently seems to be the most reasonable solution to exclude complex logging code from mutation (and code coverage).

daniel-frak avatar Feb 28 '24 13:02 daniel-frak