From 92fd4ece0d4662baac5de3dac05c71127af972cb Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Thu, 14 Apr 2022 18:16:11 +0200 Subject: [PATCH] damnit --- .../algolia/methods/requests/search.test.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java index f4d103bfe3..7f117b8d09 100644 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java +++ b/tests/output/java/src/test/java/com/algolia/methods/requests/search.test.java @@ -721,6 +721,16 @@ void delTest1() { assertEquals(req.getPath(), "/1/test/all"); assertEquals(req.getMethod(), "DELETE"); + + HashMap expectedQuery = JSON.deserialize( + "{\"query\":\"parameters\"}", + new TypeToken>() {}.getType() + ); + List actualQuery = req.getQueryParams(); + assertEquals(expectedQuery.size(), actualQuery.size()); + for (Pair p : actualQuery) { + assertEquals(expectedQuery.get(p.getName()), p.getValue()); + } } @Test @@ -878,6 +888,16 @@ void getTest1() { assertEquals(req.getPath(), "/1/test/all"); assertEquals(req.getMethod(), "GET"); + + HashMap expectedQuery = JSON.deserialize( + "{\"query\":\"parameters\"}", + new TypeToken>() {}.getType() + ); + List actualQuery = req.getQueryParams(); + assertEquals(expectedQuery.size(), actualQuery.size()); + for (Pair p : actualQuery) { + assertEquals(expectedQuery.get(p.getName()), p.getValue()); + } } @Test @@ -1485,6 +1505,24 @@ void postTest1() { assertEquals(req.getPath(), "/1/test/all"); assertEquals(req.getMethod(), "POST"); + + assertDoesNotThrow(() -> { + JSONAssert.assertEquals( + "{\"body\":\"parameters\"}", + req.getBody(), + JSONCompareMode.STRICT_ORDER + ); + }); + + HashMap expectedQuery = JSON.deserialize( + "{\"query\":\"parameters\"}", + new TypeToken>() {}.getType() + ); + List actualQuery = req.getQueryParams(); + assertEquals(expectedQuery.size(), actualQuery.size()); + for (Pair p : actualQuery) { + assertEquals(expectedQuery.get(p.getName()), p.getValue()); + } } @Test @@ -1527,6 +1565,24 @@ void putTest1() { assertEquals(req.getPath(), "/1/test/all"); assertEquals(req.getMethod(), "PUT"); + + assertDoesNotThrow(() -> { + JSONAssert.assertEquals( + "{\"body\":\"parameters\"}", + req.getBody(), + JSONCompareMode.STRICT_ORDER + ); + }); + + HashMap expectedQuery = JSON.deserialize( + "{\"query\":\"parameters\"}", + new TypeToken>() {}.getType() + ); + List actualQuery = req.getQueryParams(); + assertEquals(expectedQuery.size(), actualQuery.size()); + for (Pair p : actualQuery) { + assertEquals(expectedQuery.get(p.getName()), p.getValue()); + } } @Test