Skip to content

Commit 86e7fa6

Browse files
authored
Update to avaje-jsonb 3.0-RC7 with SimpleMapper renamed to JsonMapper (#562)
For http-client SingleBodyAdapter and Cognito AuthTokenProvider
1 parent a9a4bbb commit 86e7fa6

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

aws-cognito/http-client-authtoken/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
<dependency>
2424
<groupId>io.avaje</groupId>
2525
<artifactId>avaje-json-core</artifactId>
26-
<version>3.0-RC6</version>
26+
<version>3.0-RC7</version>
2727
</dependency>
2828

2929
<!-- test dependencies -->
3030
<dependency>
3131
<groupId>io.avaje</groupId>
3232
<artifactId>avaje-json-node</artifactId>
33-
<version>3.0-RC6</version>
33+
<version>3.0-RC7</version>
3434
<scope>test</scope>
3535
</dependency>
3636

aws-cognito/http-client-authtoken/src/main/java/io/avaje/aws/client/cognito/AmzCognitoAuthTokenProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import io.avaje.http.client.AuthTokenProvider;
55
import io.avaje.http.client.BasicAuthIntercept;
66
import io.avaje.http.client.HttpClientRequest;
7-
import io.avaje.json.simple.SimpleMapper;
7+
import io.avaje.json.mapper.JsonMapper;
88

99
import java.net.http.HttpResponse;
1010
import java.time.Instant;
@@ -47,7 +47,7 @@ public AuthTokenProvider build() {
4747

4848
private static final class Provider implements AuthTokenProvider {
4949

50-
private static final SimpleMapper MAPPER = SimpleMapper.builder().build();
50+
private static final JsonMapper MAPPER = JsonMapper.builder().build();
5151

5252
private final String url;
5353
private final String clientId;

http-client/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
<dependency>
3737
<groupId>io.avaje</groupId>
3838
<artifactId>avaje-jsonb</artifactId>
39-
<version>3.0-RC6</version>
39+
<version>3.0-RC7</version>
4040
<optional>true</optional>
4141
</dependency>
4242

4343
<dependency>
4444
<groupId>io.avaje</groupId>
4545
<artifactId>avaje-json-node</artifactId>
46-
<version>3.0-RC6</version>
46+
<version>3.0-RC7</version>
4747
<scope>test</scope>
4848
</dependency>
4949

http-client/src/main/java/io/avaje/http/client/DSingleAdapter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.avaje.http.client;
22

33
import io.avaje.http.client.SingleBodyAdapter.JsonBodyAdapter;
4-
import io.avaje.json.simple.SimpleMapper;
4+
import io.avaje.json.mapper.JsonMapper;
55

66
import java.util.List;
77

@@ -10,7 +10,7 @@ final class DSingleAdapter implements BodyAdapter {
1010

1111
private final ReaderWriter<?> adapter;
1212

13-
static BodyAdapter of(SimpleMapper.Type<?> jsonType) {
13+
static BodyAdapter of(JsonMapper.Type<?> jsonType) {
1414
return new DSingleAdapter(toAdapter(jsonType));
1515
}
1616

@@ -22,7 +22,7 @@ private DSingleAdapter(JsonBodyAdapter<?> source) {
2222
this.adapter = new ReaderWriter<>(source);
2323
}
2424

25-
private static <T> JsonBodyAdapter<T> toAdapter(SimpleMapper.Type<T> jsonType) {
25+
private static <T> JsonBodyAdapter<T> toAdapter(JsonMapper.Type<T> jsonType) {
2626
return new SimpleJsonAdapter<>(jsonType);
2727
}
2828

@@ -72,9 +72,9 @@ public BodyContent write(T bean) {
7272

7373
private static final class SimpleJsonAdapter<T> implements JsonBodyAdapter<T> {
7474

75-
private final SimpleMapper.Type<T> jsonType;
75+
private final JsonMapper.Type<T> jsonType;
7676

77-
public SimpleJsonAdapter(SimpleMapper.Type<T> jsonType) {
77+
public SimpleJsonAdapter(JsonMapper.Type<T> jsonType) {
7878
this.jsonType = jsonType;
7979
}
8080

http-client/src/main/java/io/avaje/http/client/SingleBodyAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.avaje.http.client;
22

3-
import io.avaje.json.simple.SimpleMapper;
3+
import io.avaje.json.mapper.JsonMapper;
44

55
/**
66
* A BodyAdapter that supports converting the request/response body to a single type.
@@ -25,7 +25,7 @@ static BodyAdapter create(JsonBodyAdapter<?> jsonAdapter) {
2525
* @param jsonType The only type supported to read or write the body content.
2626
* @return The BodyAdapter that the HttpClient can use.
2727
*/
28-
static BodyAdapter create(SimpleMapper.Type<?> jsonType) {
28+
static BodyAdapter create(JsonMapper.Type<?> jsonType) {
2929
return DSingleAdapter.of(jsonType);
3030
}
3131

http-client/src/test/java/io/avaje/http/client/HelloControllerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.avaje.http.client;
22

33
import com.fasterxml.jackson.databind.ObjectMapper;
4-
import io.avaje.json.simple.SimpleMapper;
4+
import io.avaje.json.mapper.JsonMapper;
55
import org.example.webserver.ErrorResponse;
66
import org.example.webserver.HelloDto;
77
import org.junit.jupiter.api.Test;
@@ -821,9 +821,9 @@ void get_bean_404() {
821821

822822
@Test
823823
void singleBodyAdapter_returningBean() {
824-
var simpleMapper = SimpleMapper.builder().build();
824+
var mapper = JsonMapper.builder().build();
825825

826-
SimpleMapper.Type<HelloDto> type = simpleMapper.type(new HelloDtoAdapter());
826+
JsonMapper.Type<HelloDto> type = mapper.type(new HelloDtoAdapter());
827827
BodyAdapter bodyAdapter = SingleBodyAdapter.create(type);
828828
HttpClient client = client(bodyAdapter);
829829

0 commit comments

Comments
 (0)