Not able to mock kubernetesClient.pods().inNamespace().list() #5681
Unanswered
SrihithaG29
asked this question in
Q&A
Replies: 1 comment 13 replies
-
Could you please clarify what mocking tool you're using. If you're not using the Kubernetes Mock Server (which we provide as JUnit extension), then I'd suggest to do so. Using other Mocking tools such as Mockito can be extremely complicated and hard to maintain. |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @manusa / @rohanKanojia / Team
I'm trying to mock this line "PodList podList = kc.pods().inNamespace(namespace).list();" in the below method.
but it is being failed with UnknownHostException:
I've tried mocking in multiple ways but it is being failed with this Caused by: java.net.UnknownHostException: kubernetes.default.svc.
Please let me know, if there is away to write junits for listing pods. Thanks in advance.
Thanks,
Srihitha.
Beta Was this translation helpful? Give feedback.
All reactions