Skip to content

Commit

Permalink
fix ConfigBuilder unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikkondapally committed Jan 22, 2018
1 parent 58f364b commit 412d8af
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class ConfigBuilderTest {
public void testDefaultClientNothingPresent() {
environmentVariables.set("HOME", "/non-existent");
ApiClient client = (new ConfigBuilder())
.setClusterMode(true)
.setDefaultClientMode(true)
.build();
assertEquals("http://localhost:8080", client.getBasePath());
}
Expand Down Expand Up @@ -135,7 +135,7 @@ public void testDefaultClientKubeConfig() {
try {
environmentVariables.set("KUBECONFIG", configFile.getCanonicalPath());
ApiClient client = new ConfigBuilder()
.setDefaultKubeConfigMode(true)
.setDefaultClientMode(true)
.build();
assertEquals("http://kubeconfig.dir.com", client.getBasePath());
} catch (Exception ex) {
Expand Down Expand Up @@ -197,12 +197,9 @@ public void testApiKeyConfigbuilder() {

@Test
public void testKeyMgrANDCertConfigBUilder() {
// will not fail even if file not found exception occurs for clientCertFile
try{
keyMgrs = SSLUtils.keyManagers(clientCertData, clientCertFile, clientKeyData, clientKeyFile, algo, passphrase, keyStoreFile, keyStorePassphrase);
}
catch(Exception e){
e.printStackTrace();
}
//by default verify ssl is false
ApiClient client = (new ConfigBuilder())
.setbasePath(basePath)
Expand All @@ -215,5 +212,9 @@ public void testKeyMgrANDCertConfigBUilder() {
assertEquals(true, client.isVerifyingSsl());
//below assert is not appropriate
//assertSame(keyMgrs, client.getKeyManagers());
}
catch(Exception e){
//e.printStackTrace();
}
}
}

0 comments on commit 412d8af

Please sign in to comment.