Skip to content
Permalink
Browse files
[JENKINS-25735] [JENKINS-41955] - Tests should invalidate caches wher…
…e possible
  • Loading branch information
oleg-nenashev committed Mar 16, 2017
1 parent ffd1d9b commit d3d8c23e099f8b503b2af375105f5ffc03fad9c3
@@ -182,7 +182,7 @@ public synchronized void clear() {
invalidatePasswordValueClassCaches();
}

public synchronized void invalidatePasswordValueClassCaches() {
/*package*/ synchronized void invalidatePasswordValueClassCaches() {
paramValueCache_maskedClasses.clear();
paramValueCache_nonMaskedClasses.clear();
}
@@ -42,6 +42,7 @@
import java.net.URLEncoder;
import java.util.Set;
import java.util.TreeSet;
import org.junit.Before;

@Issue("JENKINS-34908")
public class MaskPasswordsURLEncodingTest {
@@ -52,7 +53,11 @@ public class MaskPasswordsURLEncodingTest {
@Rule
public RestartableJenkinsRule story = new RestartableJenkinsRule();


@Before
public void dropCache() {
MaskPasswordsConfig.getInstance().clear();
}

@Test
public void passwordMaskedEncoded() throws Exception {
story.addStep(new Statement() {
@@ -47,6 +47,7 @@
import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.runners.model.Statement;
@@ -63,6 +64,11 @@ public class MaskPasswordsWorkflowTest {
@Rule
public RestartableJenkinsRule story = new RestartableJenkinsRule();

@Before
public void dropCache() {
MaskPasswordsConfig.getInstance().clear();
}

@Test
public void configRoundTrip() throws Exception {
story.addStep(new Statement() {
@@ -39,6 +39,7 @@
import java.io.IOException;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
@@ -59,6 +60,11 @@ public class PasswordParameterTest {
@Rule
public JenkinsRule j = new JenkinsRule();

@Before
public void dropCache() {
MaskPasswordsConfig.getInstance().clear();
}

@Test
@Issue("JENKINS-41955")
public void shouldMaskPasswordParameterClassByDefault() {

0 comments on commit d3d8c23

Please sign in to comment.