Skip to content

Commit

Permalink
Fix tests following Jenkins build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
akaryakina committed Jul 16, 2021
1 parent 994460e commit b1e8b7b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/fortify/plugin/jenkins/FortifyPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,13 @@ public String getProxyUrl() {
// backwards compatibility
/** @deprecated use {@link #getProxyConfig()} */
public String getProxyUsername() {
return proxyConfig != null ? (proxyConfig.getProxyUsername() != null ? proxyConfig.getProxyUsername().getEncryptedValue() : null) : null;
return proxyConfig != null ? (proxyConfig.getProxyUsername() != null ? proxyConfig.getProxyUsername().getPlainText() : null) : null;
}

// backwards compatibility
/** @deprecated use {@link #getProxyConfig()} */
public String getProxyPassword() {
return proxyConfig != null ? (proxyConfig.getProxyPassword() != null ? proxyConfig.getProxyPassword().getEncryptedValue() : null) : null;
return proxyConfig != null ? (proxyConfig.getProxyPassword() != null ? proxyConfig.getProxyPassword().getPlainText() : null) : null;
}

public ProxyConfig getProxyConfig() {
Expand Down Expand Up @@ -1020,7 +1020,7 @@ public Integer getBreakdownPageSize() {
@DataBoundSetter
public void setBreakdownPageSize(Integer breakdownPageSize) {
if (breakdownPageSize == null) {
breakdownPageSize = DEFAULT_PAGE_SIZE;
this.breakdownPageSize = DEFAULT_PAGE_SIZE;
LOGGER.log(Level.INFO, "Cannot restore 'Issue breakdown page size' property. Will use default (" + DEFAULT_PAGE_SIZE + ") value.");
} else {
this.breakdownPageSize = breakdownPageSize;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/fortify/plugin/jenkins/ProxyConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public Secret getProxyUsername() {
}

String getProxyUsernameValueOrNull() {
return proxyUsername == null ? null : proxyUsername.getEncryptedValue();
return proxyUsername == null ? null : proxyUsername.getPlainText();
}

public Secret getProxyPassword() {
return proxyPassword;
}

String getProxyPasswordValueOrNull() {
return proxyPassword == null ? null : proxyPassword.getEncryptedValue();
return proxyPassword == null ? null : proxyPassword.getPlainText();
}

@Extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.jvnet.hudson.test.RestartableJenkinsRule;

import hudson.util.Secret;
import io.jenkins.plugins.casc.misc.RoundTripAbstractTest;

public class FortifyJCasCCompatibilityTest extends RoundTripAbstractTest {
Expand Down Expand Up @@ -42,8 +43,8 @@ protected void assertConfiguredAsExpected(RestartableJenkinsRule restartableJenk
assertEquals(String.format("Wrong page size. Expected %s but received %s", Integer.valueOf(40), descriptor.getBreakdownPageSize()),
Integer.valueOf(40), descriptor.getBreakdownPageSize());
assertTrue("Proxy should be used", descriptor.getUseProxy());
assertEquals(String.format("Wrong proxy authentication. Username expected %s but received %s", "fakeuser",
descriptor.getProxyConfig().getProxyUsername()), "fakeuser", descriptor.getProxyConfig().getProxyUsername());
assertEquals(String.format("Wrong proxy authentication. Username expected %s but received %s", Secret.fromString("fakeuser"),
descriptor.getProxyConfig().getProxyUsername()), Secret.fromString("fakeuser"), descriptor.getProxyConfig().getProxyUsername());
assertEquals(String.format("Wrong proxy authentication. Username expected %s but received %s", "fakeuser",
descriptor.getProxyUsername()), "fakeuser", descriptor.getProxyUsername());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
unclassified:
fortify:
fortifyPlugin:
url: "https://qa-plg-ssc3.prgqa.hpecorp.net:8443/ssc"
token: "3ab8c774-0850-483b-8be6-2907722a81d8"
proxyConfig:
Expand Down

0 comments on commit b1e8b7b

Please sign in to comment.