]> source.dussan.org Git - sonarqube.git/commitdiff
Delete unused methods in org.sonar.test.html classes
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 14 May 2019 07:40:27 +0000 (09:40 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 14 May 2019 18:21:11 +0000 (20:21 +0200)
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlFragmentAssert.java
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlListAssert.java
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlParagraphAssert.java
sonar-testing-harness/src/main/java/org/sonar/test/html/MimeMessageAssert.java

index 3054112afb58189a6fa2536552d2a455ca4415e5..636f8664e161fa59a369c7fedc666a478c40ee74 100644 (file)
@@ -66,13 +66,4 @@ public class HtmlFragmentAssert extends AbstractAssert<HtmlFragmentAssert, Strin
       .withText(text);
   }
 
-  /**
-   * Convenience method.
-   * Sames as {@code hasParagraph().withLines(line1, line2, ...)}.
-   */
-  public HtmlParagraphAssert hasParagraph(String firstLine, String... otherLines) {
-    return hasParagraph()
-      .withLines(firstLine, otherLines);
-  }
-
 }
index 8f75fd56c228b7d469c42df3312596573c6665f6..6501d026cf1b3f4ccb23761c17b4643d90781838 100644 (file)
@@ -66,19 +66,6 @@ public class HtmlListAssert extends HtmlBlockAssert<HtmlListAssert> {
     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<HtmlListAssert> {
     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();
-  }
-
 }
index 2f073a7b7d3003975968694754ebeb6c26e5c4f5..cebc6d811d0a708471c64468c7ae4a91a4f9901c 100644 (file)
@@ -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<HtmlParagraphAssert> {
     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<HtmlParagraphAssert> {
     return this;
   }
 
-  /**
-   * Verifies the current block has all and only the specified lines, in any order.
-   */
-  public HtmlParagraphAssert withLines(Set<String> lines) {
-    isNotNull();
-
-    List<String> 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<String> toLines(Element parent) {
     Iterator<Node> iterator = parent.childNodes().iterator();
     if (!iterator.hasNext()) {
index 0ca6aaede72b9173af5e0e68b7f08d6d95e39466..8c288f326e02a4b182174e56d8458ff8eb2aafb3 100644 (file)
@@ -71,18 +71,6 @@ public final class MimeMessageAssert extends AbstractAssert<MimeMessageAssert, M
     return this;
   }
 
-  public MimeMessageAssert hasSubject(String text) {
-    isNotNull();
-
-    try {
-      Assertions.assertThat(actual.getSubject()).isEqualTo(text);
-    } catch (MessagingException e) {
-      throw new IllegalStateException(e);
-    }
-
-    return this;
-  }
-
   public MimeMessageAssert subjectContains(String text) {
     isNotNull();