From d25ecbed896aee26bf440de89f2ded1e6ee81c1e Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 14 May 2019 09:40:27 +0200 Subject: [PATCH] Delete unused methods in org.sonar.test.html classes --- .../sonar/test/html/HtmlFragmentAssert.java | 9 ------ .../org/sonar/test/html/HtmlListAssert.java | 31 ------------------- .../sonar/test/html/HtmlParagraphAssert.java | 26 ---------------- .../sonar/test/html/MimeMessageAssert.java | 12 ------- 4 files changed, 78 deletions(-) diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlFragmentAssert.java b/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlFragmentAssert.java index 3054112afb5..636f8664e16 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlFragmentAssert.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlFragmentAssert.java @@ -66,13 +66,4 @@ public class HtmlFragmentAssert extends AbstractAssert { return this; } - public HtmlListAssert hasList() { - isNotNull(); - - Assertions.assertThat(nextBlocks.hasNext()) - .describedAs("no more block") - .isTrue(); - - Element element = nextBlocks.next(); - verifyIsList(element); - - return new HtmlListAssert(element, nextBlocks); - } - /** * Convenience method. * Sames as {@code hasParagraph().withText(text)}. @@ -118,22 +105,4 @@ public class HtmlListAssert extends HtmlBlockAssert { HtmlParagraphAssert.verifyIsParagraph(element); return element; } - - /** - * Verifies there is no more list in the block. - */ - public void noMoreBlock() { - isNotNull(); - - Assertions.assertThat(nextBlocks.hasNext()) - .describedAs("there are still some block. Next one:" + PRINT_FRAGMENT_TEMPLATE, - new Object() { - @Override - public String toString() { - return nextBlocks.next().toString(); - } - }) - .isFalse(); - } - } diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlParagraphAssert.java b/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlParagraphAssert.java index 2f073a7b7d3..cebc6d811d0 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlParagraphAssert.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlParagraphAssert.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; -import java.util.Set; import java.util.stream.Stream; import org.assertj.core.api.Assertions; import org.jsoup.nodes.Element; @@ -89,15 +88,6 @@ public class HtmlParagraphAssert extends HtmlBlockAssert { return new HtmlParagraphAssert(paragraph, nextBlocks); } - /** - * Convenience method. - * Sames as {@code hasParagraph().withLines(line1, line2, ...)}. - */ - public HtmlParagraphAssert hasParagraph(String firstLine, String... otherLines) { - return hasParagraph() - .withLines(firstLine, otherLines); - } - /** * Verifies there is no more block. */ @@ -147,22 +137,6 @@ public class HtmlParagraphAssert extends HtmlBlockAssert { return this; } - /** - * Verifies the current block has all and only the specified lines, in any order. - */ - public HtmlParagraphAssert withLines(Set lines) { - isNotNull(); - - List actualLines = toLines(actual); - String[] expectedLines = lines.toArray(new String[0]); - - Assertions.assertThat(actualLines) - .describedAs(PRINT_FRAGMENT_TEMPLATE, actual) - .containsOnly(expectedLines); - - return this; - } - private static List toLines(Element parent) { Iterator iterator = parent.childNodes().iterator(); if (!iterator.hasNext()) { diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/html/MimeMessageAssert.java b/sonar-testing-harness/src/main/java/org/sonar/test/html/MimeMessageAssert.java index 0ca6aaede72..8c288f326e0 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/html/MimeMessageAssert.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/html/MimeMessageAssert.java @@ -71,18 +71,6 @@ public final class MimeMessageAssert extends AbstractAssert