MCPcopy Index your code
hub / github.com/OpenFeign/feign / FormPropertyTest

Class FormPropertyTest

form/src/test/java/feign/form/FormPropertyTest.java:33–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31import org.springframework.boot.test.context.SpringBootTest;
32
33@SpringBootTest(webEnvironment = DEFINED_PORT, classes = Server.class)
34class FormPropertyTest {
35
36 private static FormClient API;
37
38 @TempDir static Path logDir;
39
40 @BeforeAll
41 static void configureClient() {
42 var logFile = logDir.resolve("log.txt").toString();
43
44 API =
45 Feign.builder()
46 .encoder(new FormEncoder(new JacksonEncoder()))
47 .logger(new JavaLogger(FormPropertyTest.class).appendToFile(logFile))
48 .logLevel(FULL)
49 .target(FormClient.class, "http://localhost:8080");
50 }
51
52 @Test
53 void test() {
54 var dto = new FormDto("Amigo", 23);
55
56 assertThat(API.postData(dto)).isEqualTo("Amigo=23");
57 }
58
59 interface FormClient {
60
61 @RequestLine("POST /form-data")
62 @Headers("Content-Type: application/x-www-form-urlencoded")
63 String postData(FormDto dto);
64 }
65}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected