Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upMocking of InitialContext not working in @Tested instantiation #168
Labels
Comments
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to test a class that does a new InitialContext().lookup(String) in its constructor:
If A is instantiated via @tested, InitialContext is not properly mocked. A NoInitialContextException is raised on calling lookup()
Using the MockUp API does not help:
If class A is instantiated in a @before method, everything seems to be working.