Add method to set request method
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 5 May 2017 22:36:31 +0000 (00:36 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 5 May 2017 22:36:31 +0000 (00:36 +0200)
src/test/java/net/pterodactylus/sone/web/pages/WebPageTest.java

index 9d77df7..f341238 100644 (file)
@@ -309,6 +309,11 @@ public abstract class WebPageTest {
                when(webInterface.getCurrentSoneWithoutCreatingSession(toadletContext)).thenReturn(null);
        }
 
+       protected void setMethod(Method method) {
+               when(freenetRequest.getMethod()).thenReturn(method);
+               when(httpRequest.getMethod()).thenReturn(method.name());
+       }
+
        protected void request(String uri, Method method) {
                try {
                        when(httpRequest.getPath()).thenReturn(uri);