-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Can not mock K8S api /version #23023
Comments
cc @manusa |
So is this still an issue with Quarkus |
The The expectation is based on a defaulted The recommended approach (which works with any version), is to clear the default expectations on the test setup: @BeforeEach
void setUp() {
server.getKubernetesMockServer().clearExpectations();
} I'm still not sure if we should expose the default versionInfo field, and allow users to modify it. Or just recommend the current workaround/best practice. (Input is welcome) |
Yes, however, as explained, I would call it feature instead of issue 😄 |
Gotcha, so let's close this then :) |
Thank you all for providing the workaround and link to the resolved ticket. |
Describe the bug
Cannot mock the
/version
api. I followed the guide https://quarkus.io/guides/kubernetes-client#testing.Mocking
/version
works on2.4.2.Final
, but fails on2.5.4.Final
and2.6.2.Final
.The following code should throw an exception when the version path is accessed, but it does not thrown an error for v2.5.4 or higher:
However the following code works as expected with Quarkus 2.4.2 (note there are some api changes).
Expected behavior
Should allow to mock /version api.
Actual behavior
Mock of /version does not have any impact.
How to Reproduce?
See code above.
Output of
uname -a
orver
Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64
Output of
java -version
openjdk version "17.0.1" 2021-10-19
GraalVM version (if different from Java)
not relevant
Quarkus version or git rev
2.6.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: