Browse Source

Delete unused methods in org.sonar.test.html classes

tags/7.8
Simon Brandhof 5 years ago
parent
commit
d25ecbed89

+ 0
- 9
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlFragmentAssert.java View 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);
}

}

+ 0
- 31
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlListAssert.java View 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();
}

}

+ 0
- 26
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlParagraphAssert.java View 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()) {

+ 0
- 12
sonar-testing-harness/src/main/java/org/sonar/test/html/MimeMessageAssert.java View 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();


Loading…
Cancel
Save