mirror of https://github.com/zlatinb/muwire
update tests
parent
64a73e4fad
commit
c1cd242f3f
|
@ -100,7 +100,7 @@ class ConnectionAcceptorTest {
|
|||
connectionEstablisher = connectionEstablisherMock.proxyInstance()
|
||||
|
||||
acceptor = new ConnectionAcceptor(eventBus, null, null, connectionManager, settings, i2pAcceptor,
|
||||
hostCache, trustService, searchManager, uploadManager, null, connectionEstablisher, null, null, null,
|
||||
hostCache, trustService, searchManager, uploadManager, null, connectionEstablisher, null, null, null, null,
|
||||
{f, p -> true} as BiPredicate)
|
||||
acceptor.start()
|
||||
Thread.sleep(100)
|
||||
|
|
|
@ -4,7 +4,7 @@ import org.junit.Test;
|
|||
|
||||
public class HTMLSanitizerTest {
|
||||
|
||||
private static void assertSantizied(String raw, String sanitized) {
|
||||
private static void assertSanitized(String raw, String sanitized) {
|
||||
assert HTMLSanitizer.sanitize(raw).equals("<html><body>" + sanitized + "</body></html>");
|
||||
}
|
||||
@Test
|
||||
|
@ -14,20 +14,21 @@ public class HTMLSanitizerTest {
|
|||
|
||||
@Test
|
||||
public void testSingleChars() {
|
||||
assertSantizied("&", "&");
|
||||
assertSantizied("\"",""");
|
||||
assertSantizied("<","<");
|
||||
assertSantizied(">",">");
|
||||
assertSanitized("&", "&");
|
||||
assertSanitized("\"",""");
|
||||
assertSanitized("<","<");
|
||||
assertSanitized(">",">");
|
||||
assertSanitized(" ", " ");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvilHTMLDoubleQuote() {
|
||||
assertSantizied("<html><img src=\"my.tracking.server.com\"/></html>",
|
||||
"<html><img src="my.tracking.server.com"/></html>");
|
||||
assertSanitized("<html><img src=\"my.tracking.server.com\"/></html>",
|
||||
"<html><img src="my.tracking.server.com"/></html>");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void textMixture() {
|
||||
assertSantizied("><\"&", "><"&");
|
||||
assertSanitized("><\"&", "><"&");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue