Describe the bug
At the moment, KubernetesMockServerExtension uses Field[] fields = testClass.getDeclaredFields(); to find out if server or client are present in the test class.
We have a use case where we want to be able to say something along the lines:
abstract class Common {
static KubernetesClient mockClient;
void mockClientMethods() {
mockClient ....
}
}
@EnableKubernetesMockClient(crud = true, https = false)
class ActualTest extends Common {
@Test
void test() {
// use mockClient
}
}
This obviously fails, because ActualTest has no such field of type KubernetesClient
Fabric8 Kubernetes Client version
6.2.0
Steps to reproduce
Already presented above.
Expected behavior
KubernetesMockServerExtension should traverse the entire hierarchy of the test class to find if a client/server is present and set it in the proper place
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3@latest
Environment
macOS
Fabric8 Kubernetes Client Logs
No response
Additional context
No response
Describe the bug
At the moment,
KubernetesMockServerExtensionusesField[] fields = testClass.getDeclaredFields();to find out if server or client are present in the test class.We have a use case where we want to be able to say something along the lines:
This obviously fails, because
ActualTesthas no such field of typeKubernetesClientFabric8 Kubernetes Client version
6.2.0
Steps to reproduce
Already presented above.
Expected behavior
KubernetesMockServerExtensionshould traverse the entire hierarchy of the test class to find if a client/server is present and set it in the proper placeRuntime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3@latest
Environment
macOS
Fabric8 Kubernetes Client Logs
No response
Additional context
No response