Fix test with Java 1.8
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 7 Jan 2017 22:46:04 +0000 (23:46 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 7 Jan 2017 22:46:04 +0000 (23:46 +0100)
src/test/java/net/pterodactylus/sone/web/WebPageTest.java
src/test/kotlin/net/pterodactylus/sone/web/OptionsPageTest.kt

index df000b8..a6f7aa3 100644 (file)
@@ -83,7 +83,7 @@ public abstract class WebPageTest {
 
        protected final TemplateContext templateContext = new TemplateContext();
        protected final HTTPRequest httpRequest = mock(HTTPRequest.class);
-       protected final Multimap<String, String> requestParameters = HashMultimap.create();
+       protected final Multimap<String, String> requestParameters = ArrayListMultimap.create();
        protected final Map<String, String> requestHeaders = new HashMap<>();
        protected final FreenetRequest freenetRequest = mock(FreenetRequest.class);
        private final PipedOutputStream responseOutputStream = new PipedOutputStream();
index b47dc34..cb8a3e5 100644 (file)
@@ -92,9 +92,9 @@ class OptionsPageTest : WebPageTest() {
 
        private fun <T> verifyThatOptionCanBeSet(option: String, setValue: Any?, expectedValue: T, getter: () -> T) {
                request("", POST)
+               addHttpRequestParameter(option, setValue.toString())
                addHttpRequestParameter("show-custom-avatars", "ALWAYS")
                addHttpRequestParameter("load-linked-images", "ALWAYS")
-               addHttpRequestParameter(option, setValue.toString())
                verifyRedirect("options.html") {
                        assertThat(getter(), equalTo(expectedValue))
                }