Skip to content

Commit

Permalink
Enable some tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos committed Jun 27, 2023
1 parent 6b937ec commit eb29952
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.helidon.integrations.micrometer.MicrometerFeature;
import io.helidon.logging.common.LogConfig;
import io.helidon.nima.webserver.WebServer;
import io.helidon.nima.webserver.WebServer.Builder;
import io.helidon.nima.webserver.http.HttpRouting;

import io.micrometer.core.instrument.Counter;
Expand Down Expand Up @@ -59,11 +60,10 @@ static WebServer startServer() {
// By default, this will pick up application.yaml from the classpath
Config config = Config.create();

WebServer server = WebServer.builder()
Builder builder = WebServer.builder()
.config(config.get("server"))
.routing(r -> setupRouting(r, config))
.build()
.start();
.routing(r -> setupRouting(r, config));
WebServer server = builder.build().start();

System.out.println("WEB server is up! http://localhost:" + server.port() + "/greet");
return server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.helidon.nima.testing.junit5.webserver.SetUpServer;
import io.helidon.nima.webclient.http1.Http1Client;
import io.helidon.nima.webclient.http1.Http1ClientResponse;
import io.helidon.nima.webserver.WebServer;
import io.helidon.nima.webserver.WebServer.Builder;

import jakarta.json.Json;
import jakarta.json.JsonBuilderFactory;
Expand Down Expand Up @@ -61,7 +61,7 @@ public MainTest(Http1Client client) {
}

@SetUpServer
public static void setup(WebServer.Builder builder) {
public static void setup(Builder builder) {
builder.routing(r -> Main.setupRouting(r, Config.create()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.helidon.nima.webserver.WebServer;

import org.hamcrest.MatcherAssert;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class MicrometerEndpointTests {
Expand All @@ -36,13 +35,11 @@ public class MicrometerEndpointTests {


@Test
@Disabled("406 Not Acceptable")
public void testDefaultEndpoint() throws ExecutionException, InterruptedException {
runTest(MicrometerFeature.DEFAULT_CONTEXT, MicrometerFeature::create);
}

@Test
@Disabled("406 Not Acceptable")
public void testExplicitEndpointWithDefaultBuiltInRegistryViaConfig() throws ExecutionException, InterruptedException {
String context = "/aa";
runTest(context, () -> MicrometerFeature.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import io.helidon.common.http.Http;
import io.helidon.common.http.Http.Header;
import io.helidon.common.http.HttpMediaType;
import io.helidon.common.media.type.MediaTypes;
import io.helidon.nima.webclient.WebClient;
import io.helidon.nima.webclient.http1.Http1Client;
Expand All @@ -38,7 +39,6 @@
import io.micrometer.prometheus.PrometheusMeterRegistry;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class MicrometerSimplePrometheusTest {
Expand Down Expand Up @@ -83,13 +83,12 @@ void prepTest() {
}

@Test
@Disabled("Cannot parse media type: TEXT_PLAIN")
public void checkViaMediaType() throws ExecutionException, InterruptedException {
timer1.record(2L, TimeUnit.SECONDS);
counter1.increment(3);
gauge1.set(4);
Http1ClientResponse response = webClient.get()
.header(Header.ACCEPT, MediaTypes.TEXT_PLAIN.toString())
.header(Header.ACCEPT, HttpMediaType.TEXT_PLAIN.toString())
.path("/micrometer")
.request();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ default void reloadTls(Tls tls) {
/**
* Fluent API builder for {@link WebServer}.
*/
class Builder implements io.helidon.common.Builder<Builder, WebServer>, Router.RouterBuilder<Builder> {
public static class Builder implements io.helidon.common.Builder<Builder, WebServer>, Router.RouterBuilder<Builder> {

private static final AtomicInteger WEBSERVER_COUNTER = new AtomicInteger(1);

Expand Down

0 comments on commit eb29952

Please sign in to comment.