-
Notifications
You must be signed in to change notification settings - Fork 1.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
EnableKubernetesMockClient fails for @Nested junit5 classes #3032
Comments
I think it'll work if you specify @EnableKubernetesMockClient(crud = true)
class OuterTest {
static KubernetesClient client;
@Test
void shouldPass() {
assertTrue(true);
}
@Nested
@EnableKubernetesMockClient(crud = true)
class NestedTest {
@Test
void shouldPass() {
assertTrue(true);
}
}
} |
Thanks, yea, I tried this as well. Although it doesn't crash, the |
Code for this extension is here: https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-server-mock/src/main/java/io/fabric8/kubernetes/client/server/mock/EnableKubernetesMockClient.java Would it be possible for you to debug what's wrong here and submit a PR? |
@dlafreniere can you provide an actual sample of what you mean? You have the annotation A sample of your exact use-case would help debug this further. |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
I bumped into this issue while writing some test involving nested Junit5 class. I've attached a reproducer project that's using Kubernetes Client v6.10.0 |
Sorry, yes I confirmed earlier this week that this was still failing. Shouldn't be that hard to fix. We just need to toggle the part of the extension where it's setting the injected fields. In any case, we might want to delay this change to after we completely analyze the more extensive MockWebServer changes (#5632). |
A test class annotated with
@EnableKubernetesMockClient
will execute@BeforeAll
for any nested classes as well, except it will fail to retrieve the annotation.To Reproduce:
Stack Trace:
The text was updated successfully, but these errors were encountered: