Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected String removeQuotes(String value) {
}

public String getPassword() {
return properties.getProperty(KEY_PASSWORD);
return removeQuotes(properties.getProperty(KEY_PASSWORD));
}

public String getClientId() {
Expand Down
24 changes: 24 additions & 0 deletions src/test/java/com/openshift/internal/client/ConfigurationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,28 @@ public void fallsBackToDefaultUrl() throws OpenShiftException, IOException {
assertTrue(configuration.getLibraServer().contains(DefaultConfiguration.LIBRA_SERVER));
assertNull(configuration.getRhlogin());
}

@Test
public void canReadPassword() throws OpenShiftException, IOException {
UserConfigurationFake userConfiguration = new UserConfigurationFake() {

protected void initFile(Writer writer) throws IOException {
writer.append(KEY_PASSWORD).append('=').append("somePassword").append('\n');
}

};
assertEquals("somePassword", userConfiguration.getPassword());
}

@Test
public void canStripQuotesOfPassword() throws OpenShiftException, IOException {
UserConfigurationFake userConfiguration = new UserConfigurationFake() {

protected void initFile(Writer writer) throws IOException {
writer.append(KEY_PASSWORD).append('=').append("'somePassword'").append('\n');
}

};
assertEquals("somePassword", userConfiguration.getPassword());
}
}