Skip to content

Commit

Permalink
test(common): remove workaround added for Fabric8 Kubernetes Mock Ser…
Browse files Browse the repository at this point in the history
…ver empty context

fabric8io/kubernetes-client#6068 has been
fixed and we've upgraded to KubernetesClient v6.13.1 which already
contains fix for the abovementioned issue.

We don't need to have this method anymore.

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia authored Jul 12, 2024
1 parent 1868f35 commit ee6f352
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,17 +470,17 @@ void exportKubernetesClientConfigToFile_whenInvalidFileProvided_thenThrowExcepti
@DisplayName("should work with KubernetesClient config provided by KubernetesMockServer")
void exportKubernetesClientConfigToFile_worksWithKubernetesMockServer(@TempDir Path temporaryFolder) throws IOException {
// When
final Path result = KubernetesMockServerUtil.exportKubernetesClientConfigToFile(mockServer, temporaryFolder.resolve("config"));
final Path result = KubernetesHelper.exportKubernetesClientConfigToFile(mockClient.getConfiguration(), temporaryFolder.resolve("config"));
// Then
final io.fabric8.kubernetes.api.model.Config kc = Serialization
.unmarshal(result.toFile(), io.fabric8.kubernetes.api.model.Config.class);
assertThat(kc)
.hasFieldOrPropertyWithValue("currentContext", "mock-server")
.hasFieldOrPropertyWithValue("currentContext", "fabric8-mock-server-context")
.satisfies(c -> assertThat(c.getContexts())
.singleElement(InstanceOfAssertFactories.type(NamedContext.class))
.hasFieldOrPropertyWithValue("name", "mock-server")
.hasFieldOrPropertyWithValue("name", "fabric8-mock-server-context")
.hasFieldOrPropertyWithValue("context.namespace", "test")
.hasFieldOrPropertyWithValue("context.user", "mock-server-user")
.hasFieldOrPropertyWithValue("context.user", "fabric8-mock-server-user")
.extracting("context.cluster").asString()
.matches("localhost:\\d+")
)
Expand All @@ -492,7 +492,7 @@ void exportKubernetesClientConfigToFile_worksWithKubernetesMockServer(@TempDir P
)
.satisfies(c -> assertThat(c.getUsers())
.singleElement(InstanceOfAssertFactories.type(NamedAuthInfo.class))
.hasFieldOrPropertyWithValue("name", "mock-server-user"));
.hasFieldOrPropertyWithValue("name", "fabric8-mock-server-user"));
}

@Test
Expand Down

This file was deleted.

0 comments on commit ee6f352

Please sign in to comment.