Not sure. What about extending the class under test and add a constructor that constructs the Mapper.Context?
On Wed, Jul 22, 2009 at 2:20 PM, David Hall <[email protected]> wrote: > It's a non-static inner class, you can't construct those outside of > the enclosing class can you? Or is my java that rusty? > > -- David > > On Wed, Jul 22, 2009 at 2:14 PM, Ted Dunning<[email protected]> wrote: > > I don't quite understand how this complicates testing but leaves this > code > > running. > > > > Why can these classes not construct a mock Context? > > > > On Wed, Jul 22, 2009 at 1:26 PM, David Hall <[email protected]> > wrote: > > > >> These won't work in the new api. As far as I can tell, the only ways > >> to fix this are to either: > >> 1) factor out a method that is testable, but this makes the code less > >> idiomatic > >> 2) abuse reflection to create a Mapper.Context (not sure about this, > >> but I imagine it's doable), and supply a utility method for this > >> 3) individually override each Mapper class in each test and include > >> similar logic to get it done. > >> > > > > > > > > -- > > Ted Dunning, CTO > > DeepDyve > > > -- Ted Dunning, CTO DeepDyve
