jackyyyyyssss commented on code in PR #7356:
URL: https://github.com/apache/seatunnel/pull/7356#discussion_r1713191403
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-http-e2e/src/test/java/org/apache/seatunnel/e2e/connector/http/HttpIT.java:
##########
@@ -176,7 +239,53 @@ public void testMultiTableHttp(TestContainer container)
throws IOException, InterruptedException {
Container.ExecResult execResult =
container.executeJob("/fake_to_multitable.conf");
Assertions.assertEquals(0, execResult.getExitCode());
- Assertions.assertTrue(execResult.getStdout().contains(successCount));
+ ObjectMapper objectMapper = new ObjectMapper();
+
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
false);
+ String mockResponse =
+ mockServerClient.retrieveRecordedRequests(
+
request().withPath("/example/httpMultiTableContentSink").withMethod("POST"),
+ Format.JSON);
+ List<Record> recordResponse =
+ objectMapper.readValue(mockResponse, new
TypeReference<List<Record>>() {});
+ recordResponse =
+ recordResponse.stream()
+ .sorted(
+ (r1, r2) ->
+ r1.getBody().getJson().getId()
+ -
r2.getBody().getJson().getId())
+ .collect(Collectors.toList());
+ Assertions.assertIterableEquals(records, recordResponse);
Review Comment:
Because the fields returned by mockresponse contain a lot of server
information, which may not be the properties of our HTTP multi table
relationship. So it is converted into a seatunnel row,
Do you think comparing JSON directly is enough?

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]