From 67cabb6cd42e0f8060f6e809da6e492580490a19 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 31 Aug 2023 08:40:38 +0200 Subject: [PATCH] Fix test --- .../rebuild/RebuildValidatorTest.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/sonyericsson/rebuild/RebuildValidatorTest.java b/src/test/java/com/sonyericsson/rebuild/RebuildValidatorTest.java index 30daff7..94a56d8 100644 --- a/src/test/java/com/sonyericsson/rebuild/RebuildValidatorTest.java +++ b/src/test/java/com/sonyericsson/rebuild/RebuildValidatorTest.java @@ -23,9 +23,7 @@ */ package com.sonyericsson.rebuild; -import java.net.URL; import org.htmlunit.HttpMethod; -import org.htmlunit.Page; import org.htmlunit.WebAssert; import org.htmlunit.WebRequest; import org.htmlunit.html.HtmlAnchor; @@ -51,7 +49,13 @@ import org.junit.Rule; import org.junit.Test; -import static org.junit.Assert.*; +import static org.hamcrest.CoreMatchers.endsWith; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.TestExtension; @@ -279,9 +283,8 @@ public void testWhenProjectWithParamsThenRebuildProjectExecutesRebuildOfLastBuil WebAssert.assertLinkPresentWithText(projectPage, "Rebuild Last"); HtmlAnchor rebuildHref = projectPage.getAnchorByText("Rebuild Last"); - assertEquals("Rebuild Last should point to the second build", - "lastCompletedBuild/rebuild/parameterized", - rebuildHref.getHrefAttribute()); + assertThat(rebuildHref.getHrefAttribute(), + endsWith("lastCompletedBuild/rebuild/parameterized")); } /**