-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
mockito 2.0.14 fails to mock jetty httpclient #233
Comments
Is this an OSGI package ? |
Also a general principle when mocking is to not mock types you don't own, there's several reasons for that see that wiki page. However the issue is probably true. But I cannot reproduce locally, do you have additional informations like jetty version, jvm version (OpenJDK, hotspot, J9, ...) ? |
yeah, i know about that rule. this is from a really tiny method and i just want to check that it invokes the start method. oracle jdk8_11, jetty 9.2.10 |
The This class should never be accessible from |
ok but the HttpClient class can be instantiated just fine by calling its constructor client = new HttpClient(); |
also the managed enum is only used inside ContainerLifeCycle. |
I now see what the problem is. Byte Buddy overrides the public method While this is a rather poorly designed API as the method should itself be package-private as it cannot be used outside of the package, Byte Buddy should be smart enough to figure this out. It is a small fix, I have it ready some time this week. Thanks for reporting! |
thanks. I agree that the package structure and api design of jetty is a bit strange. |
@raphw Thanks for the investigation |
@christophsturm Thanks for the feddback too, note mockito 2.0.0 is still in beta phase |
sure! we will just continue to use 2.0.2-beta for now which works great. |
You can use a more recent beta |
Byte Buddy 0.6.9 is released which should fix the issue. Sorry for the hick-up. (In JCenter, currently synchronizing to Maven Central.) |
No problem, you were blazingly fast ! |
…ublic parent class having a non public types in signature
…ublic parent class having a non public types in signature Reformated a bit the generator for improved readability
this fails:
(jetty 9.2.10.v20150310)
with mockito 2.0.2-beta i can mock that class without a problem.
stacktrace:
The text was updated successfully, but these errors were encountered: