|
|
@ -29,23 +29,19 @@ import io.vertx.core.Vertx; |
|
|
|
import okhttp3.OkHttpClient; |
|
|
|
import okhttp3.OkHttpClient; |
|
|
|
import okhttp3.Request; |
|
|
|
import okhttp3.Request; |
|
|
|
import okhttp3.Response; |
|
|
|
import okhttp3.Response; |
|
|
|
import org.junit.AfterClass; |
|
|
|
import org.junit.jupiter.api.AfterAll; |
|
|
|
import org.junit.BeforeClass; |
|
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
|
import org.junit.ClassRule; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
import org.junit.rules.TemporaryFolder; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class MetricsHttpServiceTest { |
|
|
|
public class MetricsHttpServiceTest { |
|
|
|
|
|
|
|
|
|
|
|
@ClassRule public static final TemporaryFolder folder = new TemporaryFolder(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Vertx vertx = Vertx.vertx(); |
|
|
|
private static final Vertx vertx = Vertx.vertx(); |
|
|
|
|
|
|
|
|
|
|
|
private static MetricsHttpService service; |
|
|
|
private static MetricsHttpService service; |
|
|
|
private static OkHttpClient client; |
|
|
|
private static OkHttpClient client; |
|
|
|
private static String baseUrl; |
|
|
|
private static String baseUrl; |
|
|
|
|
|
|
|
|
|
|
|
@BeforeClass |
|
|
|
@BeforeAll |
|
|
|
public static void initServerAndClient() { |
|
|
|
public static void initServerAndClient() { |
|
|
|
service = createMetricsHttpService(); |
|
|
|
service = createMetricsHttpService(); |
|
|
|
service.start().join(); |
|
|
|
service.start().join(); |
|
|
@ -76,7 +72,7 @@ public class MetricsHttpServiceTest { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** Tears down the HTTP server. */ |
|
|
|
/** Tears down the HTTP server. */ |
|
|
|
@AfterClass |
|
|
|
@AfterAll |
|
|
|
public static void shutdownServer() { |
|
|
|
public static void shutdownServer() { |
|
|
|
service.stop().join(); |
|
|
|
service.stop().join(); |
|
|
|
vertx.close(); |
|
|
|
vertx.close(); |
|
|
|