From a83fcdb5b07d95ad2376305d9e2471fd06a0c1a1 Mon Sep 17 00:00:00 2001 From: Santiago Pericasgeertsen Date: Mon, 18 Sep 2023 13:34:21 -0400 Subject: [PATCH] Enables headers test. Signed-off-by: Santiago Pericasgeertsen --- .../io/helidon/jersey/connector/ConnectorBase.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jersey/tests/connector/src/test/java/io/helidon/jersey/connector/ConnectorBase.java b/jersey/tests/connector/src/test/java/io/helidon/jersey/connector/ConnectorBase.java index 2b03e292a86..fbf892c03be 100644 --- a/jersey/tests/connector/src/test/java/io/helidon/jersey/connector/ConnectorBase.java +++ b/jersey/tests/connector/src/test/java/io/helidon/jersey/connector/ConnectorBase.java @@ -30,7 +30,6 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MultivaluedHashMap; import jakarta.ws.rs.core.Response; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -90,7 +89,7 @@ static void basicGetQuery(ServerRequest request, ServerResponse response) { static void basicHeaders(ServerRequest request, ServerResponse response) { request.headers() .stream() - .filter(h -> h.name().startsWith("X-TEST")) + .filter(h -> h.name().startsWith("x-test")) .forEach(response::header); response.status(Status.OK_200).send("ok"); } @@ -123,11 +122,16 @@ public void queryGetTest() { } } - @Test @Disabled + @Test public void testHeaders() { - String[][] headers = new String[][]{{"X-TEST-ONE", "ONE"}, {"X-TEST-TWO", "TWO"}, {"X-TEST-THREE", "THREE"}}; + String[][] headers = new String[][]{ + {"x-test-one", "one"}, + {"x-test-two", "two"}, + {"x-test-three", "three"} + }; MultivaluedHashMap map = new MultivaluedHashMap<>(); Arrays.stream(headers).forEach(a -> map.add(a[0], a[1])); + try (Response response = target("basic").path("headers").request().headers(map).get()) { assertThat(response.getStatus(), is(200)); assertThat(response.readEntity(String.class), is("ok"));