From 3fc317b6ff9e98642fd968d4c6b7d957138aa312 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Tue, 5 Nov 2024 12:50:42 +0100 Subject: [PATCH] fix(config): removed setFile setter (internal) Signed-off-by: Marc Nuri --- .../io/fabric8/kubernetes/client/Config.java | 4 ---- .../utils/OpenIDConnectionUtilsBehaviorTest.java | 16 ++++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java b/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java index f08faf8836..50fd323a54 100644 --- a/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java +++ b/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java @@ -1499,10 +1499,6 @@ public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } - public void setFile(File file) { - this.file = file; - } - public void setAutoConfigure(boolean autoConfigure) { this.autoConfigure = autoConfigure; } diff --git a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/OpenIDConnectionUtilsBehaviorTest.java b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/OpenIDConnectionUtilsBehaviorTest.java index a6771b3858..d5eac1f09f 100644 --- a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/OpenIDConnectionUtilsBehaviorTest.java +++ b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/OpenIDConnectionUtilsBehaviorTest.java @@ -484,15 +484,15 @@ void skipsInFileWhenOriginalConfigHasNoFile() { @Test void skipsInFileWhenOriginalConfigHasNoCurrentContext() { - originalConfig.setFile(kubeConfig); + originalConfig = new ConfigBuilder(originalConfig).withFile(kubeConfig).build(); persistOAuthToken(originalConfig, oAuthTokenResponse, "fake.token"); assertThat(kubeConfig).doesNotExist(); } @Test void logsWarningIfReferencedFileIsMissing() { - originalConfig.setFile(kubeConfig); originalConfig = new ConfigBuilder(originalConfig) + .withFile(kubeConfig) .withCurrentContext(new NamedContextBuilder().withName("context").build()).build(); persistOAuthToken(originalConfig, oAuthTokenResponse, "fake.token"); assertThat(systemErr.toString()) @@ -511,9 +511,9 @@ void setUp() throws IOException { } @Test - void persistsTokenInFile() throws IOException { - originalConfig.setFile(kubeConfig); + void persistsTokenInFile() { originalConfig = new ConfigBuilder(originalConfig) + .withFile(kubeConfig) .withCurrentContext(new NamedContextBuilder() .withName("context") .withNewContext().withUser("user").endContext().build()) @@ -524,9 +524,9 @@ void persistsTokenInFile() throws IOException { } @Test - void skipsTokenInFileIfNull() throws IOException { - originalConfig.setFile(kubeConfig); + void skipsTokenInFileIfNull() { originalConfig = new ConfigBuilder(originalConfig) + .withFile(kubeConfig) .withCurrentContext(new NamedContextBuilder() .withName("context") .withNewContext().withUser("user").endContext().build()) @@ -537,9 +537,9 @@ void skipsTokenInFileIfNull() throws IOException { } @Test - void persistsOAuthTokenInFile() throws IOException { - originalConfig.setFile(kubeConfig); + void persistsOAuthTokenInFile() { originalConfig = new ConfigBuilder(originalConfig) + .withFile(kubeConfig) .withCurrentContext(new NamedContextBuilder() .withName("context") .withNewContext().withUser("user").endContext().build())