Mock fields of inner static class with easyMock

157 views Asked by At

Is it possible to mock public fields of inner static class

public class SysConfig {

    public static class PackageConfig {
        public boolean checked;
    }

}

I want to mock "checked" field of PackageConfig class.

NOTE: I can't use powermock because i want to find coverage of code and powermock is causing some problems with it.

1

There are 1 answers

1
Karrde On

Since it's a public boolean...you could...set the value :P

Other than that, we'll need some context - how do you intend on using the mock?

P.S. As far as I know, Powermock should only give you issues with code coverage if you're mocking the class under test.