Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when using willThrow with mock Exception #90

Closed
maciejmikosik opened this issue Jul 20, 2016 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@maciejmikosik
Copy link
Owner

Object mock = mock(Object.class);
given(willThrow(mock(RuntimeException.class)), mock).toString();
mock.toString();

Exception in thread "main" java.lang.NullPointerException
at org.testory.Testory$11.handle(Testory.java:307)
at org.testory.Testory$4.handle(Testory.java:219)
at org.testory.Testory$5.handle(Testory.java:230)
at org.testory.proxy.Proxies$4.handle(Proxies.java:154)
at org.testory.proxy.Proxies$3.intercept(Proxies.java:144)
at org.testory.proxy.Proxies$ProxiableObject$$$EnhancerByCGLIB$$104ca767.toString()
at Main.main(Main.java:9)

@maciejmikosik maciejmikosik self-assigned this Apr 28, 2017
@maciejmikosik maciejmikosik added this to the 1.2.0 milestone Apr 28, 2017
@maciejmikosik
Copy link
Owner Author

stubbed fillInStackTrace to return same this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant