Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion avaje-jex-freemarker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.2</version>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion avaje-jex-grizzly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.0</version>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.avaje.jex.grizzly;

import io.avaje.http.client.HttpClientContext;
import io.avaje.http.client.HttpClient;
import io.avaje.http.client.HttpClientRequest;
import io.avaje.http.client.JacksonBodyAdapter;
import io.avaje.jex.Jex;

import java.net.http.HttpClient;
import java.util.Random;

import static java.net.http.HttpClient.Version.HTTP_1_1;

/**
* Server and Client pair for a test.
*/
Expand All @@ -17,9 +18,9 @@ public class TestPair {

private final Jex.Server server;

private final HttpClientContext client;
private final HttpClient client;

public TestPair(int port, Jex.Server server, HttpClientContext client) {
public TestPair(int port, Jex.Server server, HttpClient client) {
this.port = port;
this.server = server;
this.client = client;
Expand Down Expand Up @@ -53,10 +54,10 @@ public static TestPair create(Jex app, int port) {
var jexServer = app.port(port).start();

var url = "http://localhost:" + port;
var client = HttpClientContext.builder()
var client = HttpClient.builder()
.baseUrl(url)
.bodyAdapter(new JacksonBodyAdapter())
.version(HttpClient.Version.HTTP_1_1)
.version(HTTP_1_1)
.build();

return new TestPair(port, jexServer, client);
Expand Down
2 changes: 1 addition & 1 deletion avaje-jex-jdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.0</version>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions avaje-jex-jdk/src/test/java/io/avaje/jex/jdk/HeadersTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.avaje.jex.jdk;

import io.avaje.http.client.HttpClientContext;
import io.avaje.http.client.HttpClient;
import io.avaje.http.client.JacksonBodyAdapter;
import io.avaje.jex.Jex;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -17,7 +17,7 @@ class HeadersTest {

static final int port = new Random().nextInt(1000) + 10_000;
static Jex.Server server;
static HttpClientContext client;
static HttpClient client;

@BeforeAll
static void setup() {
Expand All @@ -33,7 +33,7 @@ static void setup() {
.port(port)
.start();

client = HttpClientContext.builder()
client = HttpClient.builder()
.baseUrl("http://localhost:"+port)
.bodyAdapter(new JacksonBodyAdapter())
.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package io.avaje.jex.jdk;

import io.avaje.http.client.HttpClientContext;
import io.avaje.http.client.HttpClient;
import io.avaje.http.client.JacksonBodyAdapter;
import io.avaje.jex.AppLifecycle;
import io.avaje.jex.Jex;
import io.avaje.jex.core.HealthPlugin;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
Expand All @@ -21,7 +20,7 @@ class HealthPluginTest {
static final int port = new Random().nextInt(1000) + 10_000;
static Jex jex;
static Jex.Server server;
static HttpClientContext client;
static HttpClient client;

@BeforeAll
static void setup() {
Expand All @@ -37,7 +36,7 @@ static void setup() {
.port(port);

server = jex.start();
client = HttpClientContext.builder()
client = HttpClient.builder()
.baseUrl("http://localhost:"+port)
.bodyAdapter(new JacksonBodyAdapter())
.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.avaje.jex.jdk;

import io.avaje.http.client.HttpClientContext;
import io.avaje.http.client.HttpClient;
import io.avaje.http.client.JacksonBodyAdapter;
import io.avaje.jex.Jex;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -28,7 +28,7 @@ void init() {
.port(8093)
.start();

final HttpClientContext client = HttpClientContext.builder()
final HttpClient client = HttpClient.builder()
.baseUrl("http://localhost:8093")
.bodyAdapter(new JacksonBodyAdapter())
.build();
Expand Down
8 changes: 4 additions & 4 deletions avaje-jex-jdk/src/test/java/io/avaje/jex/jdk/TestPair.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.avaje.jex.jdk;

import io.avaje.http.client.HttpClientContext;
import io.avaje.http.client.HttpClient;
import io.avaje.http.client.HttpClientRequest;
import io.avaje.http.client.JacksonBodyAdapter;
import io.avaje.jex.Jex;
Expand All @@ -17,9 +17,9 @@ public class TestPair {

private final Jex.Server server;

private final HttpClientContext client;
private final HttpClient client;

public TestPair(int port, Jex.Server server, HttpClientContext client) {
public TestPair(int port, Jex.Server server, HttpClient client) {
this.port = port;
this.server = server;
this.client = client;
Expand Down Expand Up @@ -54,7 +54,7 @@ public static TestPair create(Jex app, int port) {
var jexServer = app.port(port).start();

var url = "http://localhost:" + port;
var client = HttpClientContext.builder()
var client = HttpClient.builder()
.baseUrl(url)
.bodyAdapter(new JacksonBodyAdapter())
.requestTimeout(Duration.ofMinutes(2))
Expand Down
2 changes: 1 addition & 1 deletion avaje-jex-mustache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.0</version>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>

Expand Down
8 changes: 4 additions & 4 deletions avaje-jex-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-http-client</artifactId>
<version>1.36</version>
<version>2.0</version>
</dependency>

<!-- dependency injection component testing -->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-inject-test</artifactId>
<version>9.0</version>
<version>9.9</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsonb</artifactId>
<version>1.4</version>
<version>1.9</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.0</version>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.avaje.jex.test;

import io.avaje.http.client.HttpClientContext;
import io.avaje.http.client.HttpClient;
import io.avaje.inject.BeanScope;
import io.avaje.inject.test.Plugin;
import io.avaje.jex.Jex;
Expand All @@ -25,7 +25,7 @@ public final class JexInjectPlugin implements Plugin {
*/
@Override
public boolean forType(Class<?> type) {
return HttpClientContext.class.equals(type) || isHttpClientApi(type);
return HttpClient.class.equals(type) || isHttpClientApi(type);
}

private boolean isHttpClientApi(Class<?> type) {
Expand Down Expand Up @@ -57,7 +57,7 @@ public Scope createScope(BeanScope beanScope) {
private static class LocalScope implements Plugin.Scope {

private final Jex.Server server;
private final HttpClientContext httpClient;
private final HttpClient httpClient;

LocalScope(BeanScope beanScope) {
Jex jex = beanScope.getOptional(Jex.class)
Expand All @@ -68,16 +68,16 @@ private static class LocalScope implements Plugin.Scope {
// get a HttpClientContext.Builder provided by dependency injection test scope or new one up
this.server = jex.start();
int port = server.port();
this.httpClient = beanScope.getOptional(HttpClientContext.Builder.class)
.orElse(HttpClientContext.builder())
this.httpClient = beanScope.getOptional(HttpClient.Builder.class)
.orElse(HttpClient.builder())
.configureWith(beanScope)
.baseUrl("http://localhost:" + port)
.build();
}

@Override
public Object create(Class<?> type) {
if (HttpClientContext.class.equals(type)) {
if (HttpClient.class.equals(type)) {
return httpClient;
}
return apiClient(type);
Expand Down
10 changes: 4 additions & 6 deletions avaje-jex-test/src/main/java/io/avaje/jex/test/TestPair.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package io.avaje.jex.test;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.avaje.http.client.HttpClientContext;
import io.avaje.http.client.HttpClient;
import io.avaje.http.client.HttpClientRequest;
import io.avaje.http.client.JacksonBodyAdapter;
import io.avaje.http.client.RequestLogger;
import io.avaje.jex.Jex;

import java.util.Random;
Expand All @@ -18,9 +16,9 @@ public class TestPair {

private final Jex.Server server;

private final HttpClientContext client;
private final HttpClient client;

public TestPair(int port, Jex.Server server, HttpClientContext client) {
public TestPair(int port, Jex.Server server, HttpClient client) {
this.port = port;
this.server = server;
this.client = client;
Expand Down Expand Up @@ -51,7 +49,7 @@ public static TestPair create(Jex app) {
var jexServer = app.port(port).start();

var url = "http://localhost:" + port;
var client = HttpClientContext.builder()
var client = HttpClient.builder()
.baseUrl(url)
.bodyAdapter(new JacksonBodyAdapter())
.build();
Expand Down
38 changes: 19 additions & 19 deletions avaje-jex/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,50 +24,50 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-config</artifactId>
<version>3.1</version>
<version>3.9</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-inject</artifactId>
<version>9.0</version>
<version>9.9</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.0</version>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsonb</artifactId>
<version>1.4</version>
<version>1.9</version>
<optional>true</optional>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
--add-opens io.avaje.jex/io.avaje.jex.base=com.fasterxml.jackson.databind
--add-modules com.fasterxml.jackson.databind
--add-opens io.avaje.jex/io.avaje.jex=ALL-UNNAMED
--add-opens io.avaje.jex/io.avaje.jex.base=ALL-UNNAMED
--add-opens io.avaje.jex/io.avaje.jex.core=ALL-UNNAMED
--add-opens io.avaje.jex/io.avaje.jex.routes=ALL-UNNAMED
--add-opens io.avaje.jex/io.avaje.jex.jetty=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-surefire-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <argLine>-->
<!-- &#45;&#45;add-opens io.avaje.jex/io.avaje.jex.base=com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-modules com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-opens io.avaje.jex/io.avaje.jex=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.jex/io.avaje.jex.base=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.jex/io.avaje.jex.core=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.jex/io.avaje.jex.routes=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.jex/io.avaje.jex.jetty=ALL-UNNAMED-->
<!-- </argLine>-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
</build>

Expand Down
5 changes: 3 additions & 2 deletions examples/example-grizzly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<properties>
<java.release>11</java.release>
<jackson.version>2.15.0</jackson.version>
</properties>

<dependencies>
Expand All @@ -29,13 +30,13 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.0</version>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-http-client</artifactId>
<version>1.36</version>
<version>2.0</version>
</dependency>

<dependency>
Expand Down
Loading