Skip to content
Draft
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
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
<commons-codec.version>1.22.0</commons-codec.version>
<commons-lang3.version>3.20.0</commons-lang3.version>
<fastjson2.version>2.0.62</fastjson2.version>
<guava.version>31.0.1-jre</guava.version>
<jackson-bom.version>2.22.1</jackson-bom.version>
<guava.version>33.8.0-jre</guava.version>
<jackson-bom.version>2.22.3</jackson-bom.version>
<junit-jupiter.version>6.1.0</junit-jupiter.version>
<lombok.version>1.18.46</lombok.version>
<okhttp.version>4.9.3</okhttp.version>
Expand Down
15 changes: 15 additions & 0 deletions src/test/java/io/agora/cloud/AgoraOkHttp3TemplateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,21 @@ void shouldCreateRequestBuilderWithBody() throws Exception {
assertNotNull(builder);
}

@Test
void shouldSerializeGuavaRequestBodyWithJackson() throws Exception {
okhttp3.HttpUrl url = okhttp3.HttpUrl.parse("http://localhost/api");
java.util.Map<String, Object> body = com.google.common.collect.ImmutableMap.of(
"channel", "room-1", "uid", 42);
Request request = template.createRequestBuilder(url,
AgoraOkHttp3Template.HttpMethod.POST, null, body).build();
okio.Buffer buffer = new okio.Buffer();
request.body().writeTo(buffer);
com.fasterxml.jackson.databind.JsonNode json = new ObjectMapper().readTree(buffer.readUtf8());
assertEquals("room-1", json.get("channel").asText());
assertEquals(42, json.get("uid").asInt());
assertEquals("application/json;charset=UTF-8", request.body().contentType().toString());
}

// --- MediaType constants ---
@Test
void shouldHaveMediaTypeConstants() {
Expand Down
Loading