Skip to content

Commit

Permalink
fix(config): removed setFile setter (internal)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed Nov 5, 2024
1 parent 4c37d54 commit 3fc317b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down

0 comments on commit 3fc317b

Please sign in to comment.