Skip to content

Commit

Permalink
[JENKINS-37801] Use the new Matcher in CredentialsStoreActionTest
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-arabaolaza committed Aug 30, 2016
1 parent 2e8ea26 commit b12bd48
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -15,14 +15,15 @@
import java.util.List;
import java.util.Random;
import javax.servlet.http.HttpServletResponse;
import jenkins.model.Jenkins;

import org.apache.commons.lang.StringUtils;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.xmlunit.matchers.CompareMatcher;

import static com.cloudbees.plugins.credentials.XmlMatchers.isSimilarToIgnoringPrivateAttrs;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
Expand Down Expand Up @@ -57,7 +58,7 @@ public void smokes() throws Exception {

JenkinsRule.WebClient wc = j.createWebClient();
WebResponse response = wc.goTo("credentials/store/system/api/xml?depth=5", "application/xml").getWebResponse();
assertThat(response.getContentAsString(), CompareMatcher.isIdenticalTo("<userFacingAction>"
assertThat(response.getContentAsString(), isSimilarToIgnoringPrivateAttrs("<userFacingAction>"
+ "<domains>"
+ "<_>"
+ "<description>"
Expand All @@ -83,7 +84,7 @@ public void smokes() throws Exception {
new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialId,
credentialDescription, credentialUsername, "test-secret"));
response = wc.goTo("credentials/store/system/api/xml?depth=5", "application/xml").getWebResponse();
assertThat(response.getContentAsString(), CompareMatcher.isIdenticalTo("<userFacingAction>"
assertThat(response.getContentAsString(), isSimilarToIgnoringPrivateAttrs("<userFacingAction>"
+ "<domains>"
+ "<_>"
+ "<description>"
Expand Down

0 comments on commit b12bd48

Please sign in to comment.