Skip to content

Commit 6cbbd6e

Browse files
committed
Update tests.
1 parent c620599 commit 6cbbd6e

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

kilo-test/src/test/java/org/httprpc/kilo/test/TestServiceProxy.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040

4141
@ServicePath("test")
4242
public interface TestServiceProxy {
43-
interface FormData {
43+
record FormData (
4444
@Required
45-
String getString();
46-
List<String> getStrings();
47-
Integer getNumber();
48-
Instant getDate();
49-
Path getFile();
50-
List<Path> getFiles();
45+
String string,
46+
List<String> strings,
47+
Integer number,
48+
Instant date,
49+
Path file,
50+
List<Path> files
51+
) {
5152
}
5253

5354
class CustomRequestHandler implements WebServiceProxy.RequestHandler {

kilo-test/src/test/java/org/httprpc/kilo/test/WebServiceProxyTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,14 +409,14 @@ public void testFormDataPostProxy() throws URISyntaxException, IOException {
409409
var textURL = getClass().getResource("test.txt");
410410
var imageURL = getClass().getResource("test.jpg");
411411

412-
var formData = BeanAdapter.coerce(mapOf(
413-
entry("string", "héllo&gøod+bye?"),
414-
entry("strings", listOf("a", "b", "c")),
415-
entry("number", 123),
416-
entry("date", now),
417-
entry("file", Paths.get(textURL.toURI())),
418-
entry("files", listOf(Paths.get(textURL.toURI()), Paths.get(imageURL.toURI())))
419-
), TestServiceProxy.FormData.class);
412+
var formData = new TestServiceProxy.FormData(
413+
"héllo&gøod+bye?",
414+
listOf("a", "b", "c"),
415+
123,
416+
now,
417+
Paths.get(textURL.toURI()),
418+
listOf(Paths.get(textURL.toURI()), Paths.get(imageURL.toURI()))
419+
);
420420

421421
var result = testServiceProxy.testFormDataPost(formData);
422422

0 commit comments

Comments
 (0)