diff --git a/test-framework/devmode-test-utils/src/main/java/io/quarkus/test/devmode/util/DevModeTestUtils.java b/test-framework/devmode-test-utils/src/main/java/io/quarkus/test/devmode/util/DevModeTestUtils.java new file mode 100644 index 0000000000000..8d2050fa26e34 --- /dev/null +++ b/test-framework/devmode-test-utils/src/main/java/io/quarkus/test/devmode/util/DevModeTestUtils.java @@ -0,0 +1,91 @@ +package io.quarkus.test.devmode.util; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; + +/** + * @deprecated Use {@link DevModeClient} instead (the methods on that class are non-static to allow ports to be specified). + */ +@Deprecated(since = "3.3", forRemoval = true) +public class DevModeTestUtils { + + private static final DevModeClient devModeClient = new DevModeClient(); + + public static List killDescendingProcesses() { + return DevModeClient.killDescendingProcesses(); + } + + public static void filter(File input, Map variables) throws IOException { + DevModeClient.filter(input, variables); + } + + public static void awaitUntilServerDown() { + devModeClient.awaitUntilServerDown(); + } + + public static String getHttpResponse() { + return devModeClient.getHttpResponse(); + } + + public static String getHttpResponse(Supplier brokenReason) { + return devModeClient.getHttpResponse(brokenReason); + } + + public static String getHttpErrorResponse() { + return devModeClient.getHttpErrorResponse(); + } + + public static String getHttpErrorResponse(Supplier brokenReason) { + return devModeClient.getHttpErrorResponse(brokenReason); + } + + public static String getHttpResponse(String path) { + return devModeClient.getHttpResponse(path); + } + + public static String getHttpResponse(String path, Supplier brokenReason) { + return devModeClient.getHttpResponse(path, brokenReason); + } + + public static String getHttpResponse(String path, boolean allowError) { + return devModeClient.getHttpResponse(path, allowError); + } + + public static String getHttpResponse(String path, boolean allowError, Supplier brokenReason) { + return devModeClient.getHttpResponse(path, allowError, brokenReason); + } + + public static String getHttpResponse(String path, boolean allowError, Supplier brokenReason, long timeout, + TimeUnit tu) { + return devModeClient.getHttpResponse(path, allowError, brokenReason, timeout, tu); + } + + public static boolean getHttpResponse(String path, int expectedStatus) { + return devModeClient.getHttpResponse(path, expectedStatus); + } + + public static boolean getHttpResponse(String path, int expectedStatus, long timeout, TimeUnit tu) { + return devModeClient.getHttpResponse(path, expectedStatus, timeout, tu); + } + + // will fail if it receives any http response except the expected one + public static boolean getStrictHttpResponse(String path, int expectedStatus) { + return devModeClient.getStrictHttpResponse(path, expectedStatus); + } + + public static String get() throws IOException { + return devModeClient.get(); + } + + public static String get(String urlStr) throws IOException { + return devModeClient.get(urlStr); + } + + public static boolean isCode(String path, int code) { + return devModeClient.isCode(path, code); + } +}