提交 8fdd7de2 编写于 作者: F Félix Queiruga

Fix broken test due to changes on check.jelly

- e66df306 broke this test when removing the button nested within the anchor
上级 eac78f77
package hudson;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.html.DomNodeList;
import com.gargoylesoftware.htmlunit.html.HtmlButton;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlElementUtil;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
......@@ -26,8 +25,10 @@ import org.xml.sax.SAXException;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
......@@ -108,10 +109,14 @@ public class PluginManagerCheckUpdateCenterTest {
}
}
private HtmlButton getCheckNow(HtmlPage page){
DomNodeList<HtmlElement> elements = page.getElementById("bottom-sticker").getElementsByTagName("button");
private HtmlAnchor getCheckNow(HtmlPage page){
List<HtmlElement> elements = page.getElementById("bottom-sticker")
.getElementsByTagName("a")
.stream()
.filter(link -> link.getAttribute("href").equals("checkUpdatesServer"))
.collect(Collectors.toList());
assertEquals(1, elements.size());
return (HtmlButton) elements.get(0);
return (HtmlAnchor) elements.get(0);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册