From 5c3400cf1183520f74adf692150393406dae2a88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 6 May 2017 00:36:31 +0200 Subject: [PATCH] Add method to set request method --- src/test/java/net/pterodactylus/sone/web/pages/WebPageTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/net/pterodactylus/sone/web/pages/WebPageTest.java b/src/test/java/net/pterodactylus/sone/web/pages/WebPageTest.java index 9d77df7..f341238 100644 --- a/src/test/java/net/pterodactylus/sone/web/pages/WebPageTest.java +++ b/src/test/java/net/pterodactylus/sone/web/pages/WebPageTest.java @@ -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); -- 2.7.4