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