Skip to content

Commit d9d46e9

Browse files
committed
Adapt DelegateWriterTest to the new Request.Body template API
1 parent ba1cf15 commit d9d46e9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

form/src/test/java/feign/form/multipart/DelegateWriterTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static org.assertj.core.api.Assertions.assertThat;
1919

20+
import feign.Request;
2021
import feign.codec.Encoder;
2122
import java.nio.charset.StandardCharsets;
2223
import org.junit.jupiter.api.Test;
@@ -32,7 +33,7 @@ void usesContentTypeFromDelegate() throws Exception {
3233
Encoder delegate =
3334
(object, bodyType, template) -> {
3435
template.header("Content-Type", "application/json");
35-
template.body("{\"hash\":\"somehash\"}");
36+
template.body(Request.Body.of("{\"hash\":\"somehash\"}"));
3637
};
3738

3839
assertThat(write(delegate))
@@ -42,7 +43,7 @@ void usesContentTypeFromDelegate() throws Exception {
4243

4344
@Test
4445
void fallsBackToTextPlainWhenDelegateSetsNoContentType() throws Exception {
45-
Encoder delegate = (object, bodyType, template) -> template.body("plain");
46+
Encoder delegate = (object, bodyType, template) -> template.body(Request.Body.of("plain"));
4647

4748
assertThat(write(delegate)).contains("Content-Type: text/plain; charset=UTF-8");
4849
}

0 commit comments

Comments
 (0)