projoy/mockito

Move internal class Whitebox to API

GoogleCodeExporter opened this issue · 1 comments

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

At the moment I'm tempted to say no.

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

  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect