dhamini-poornachandra / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

Move internal class Whitebox to API #492

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In the context of mocking, the Whitebox class of Mockito is incredibly useful.

For example, with Java 7, it got harder to mock java.io.File because of the 
following method:

final boolean isInvalid() {
        if (status == null) {
            status = (this.path.indexOf('\u0000') < 0) ? PathStatus.CHECKED
                                                       : PathStatus.INVALID;
        }
        return status == PathStatus.INVALID;
    }

To get around the problem that this method will always yield PathStatus.INVALID 
we have to set the private field path.

Original issue reported on code.google.com by Alexander.Weickmann@gmail.com on 2 May 2014 at 9:31

GoogleCodeExporter commented 8 years ago
At the moment I'm tempted to say no.

Original comment by brice.du...@gmail.com on 27 Jun 2014 at 5:08