Skip to content

Commit

Permalink
damnit
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Apr 15, 2022
1 parent 67f651b commit 92fd4ec
Showing 1 changed file with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,16 @@ void delTest1() {

assertEquals(req.getPath(), "/1/test/all");
assertEquals(req.getMethod(), "DELETE");

HashMap<String, String> expectedQuery = JSON.deserialize(
"{\"query\":\"parameters\"}",
new TypeToken<HashMap<String, String>>() {}.getType()
);
List<Pair> actualQuery = req.getQueryParams();
assertEquals(expectedQuery.size(), actualQuery.size());
for (Pair p : actualQuery) {
assertEquals(expectedQuery.get(p.getName()), p.getValue());
}
}

@Test
Expand Down Expand Up @@ -878,6 +888,16 @@ void getTest1() {

assertEquals(req.getPath(), "/1/test/all");
assertEquals(req.getMethod(), "GET");

HashMap<String, String> expectedQuery = JSON.deserialize(
"{\"query\":\"parameters\"}",
new TypeToken<HashMap<String, String>>() {}.getType()
);
List<Pair> actualQuery = req.getQueryParams();
assertEquals(expectedQuery.size(), actualQuery.size());
for (Pair p : actualQuery) {
assertEquals(expectedQuery.get(p.getName()), p.getValue());
}
}

@Test
Expand Down Expand Up @@ -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<String, String> expectedQuery = JSON.deserialize(
"{\"query\":\"parameters\"}",
new TypeToken<HashMap<String, String>>() {}.getType()
);
List<Pair> actualQuery = req.getQueryParams();
assertEquals(expectedQuery.size(), actualQuery.size());
for (Pair p : actualQuery) {
assertEquals(expectedQuery.get(p.getName()), p.getValue());
}
}

@Test
Expand Down Expand Up @@ -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<String, String> expectedQuery = JSON.deserialize(
"{\"query\":\"parameters\"}",
new TypeToken<HashMap<String, String>>() {}.getType()
);
List<Pair> actualQuery = req.getQueryParams();
assertEquals(expectedQuery.size(), actualQuery.size());
for (Pair p : actualQuery) {
assertEquals(expectedQuery.get(p.getName()), p.getValue());
}
}

@Test
Expand Down

0 comments on commit 92fd4ec

Please sign in to comment.