From 731c86ea3c69e8498317c59402c4b94ebdf2006b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 11 Feb 2016 11:37:15 +0100 Subject: [PATCH] Better defect localization --- .../java/jenkins/model/JenkinsLocationConfigurationTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/src/test/java/jenkins/model/JenkinsLocationConfigurationTest.java b/test/src/test/java/jenkins/model/JenkinsLocationConfigurationTest.java index 9acce428f7..09d7d4c27c 100644 --- a/test/src/test/java/jenkins/model/JenkinsLocationConfigurationTest.java +++ b/test/src/test/java/jenkins/model/JenkinsLocationConfigurationTest.java @@ -1,6 +1,7 @@ package jenkins.model; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; import com.gargoylesoftware.htmlunit.html.HtmlInput; import com.gargoylesoftware.htmlunit.html.HtmlPage; @@ -24,6 +25,6 @@ public class JenkinsLocationConfigurationTest { HtmlPage p = j.createWebClient().goTo("configure"); HtmlInput url = p.getFormByName("config").getInputByName("_.url"); url.setValueAttribute("http://localhost:1234/"); - assertTrue(p.getDocumentElement().getTextContent().contains("instead of localhost")); + assertThat(p.getDocumentElement().getTextContent(), containsString("instead of localhost")); } }