vlsi commented on a change in pull request #660:
URL: https://github.com/apache/jmeter/pull/660#discussion_r757512474



##########
File path: 
src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/util/TestGraphQLRequestParamUtils.java
##########
@@ -97,9 +102,24 @@ void testInvalidGraphQLContentType(String contentType) {
         
assertFalse(GraphQLRequestParamUtils.isGraphQLContentType(contentType));
     }
 
-    @Test
-    void testToPostBodyString() throws Exception {
-        assertEquals(EXPECTED_POST_BODY, 
GraphQLRequestParamUtils.toPostBodyString(params));
+    static Stream<Triple<String, JsonNode, JsonNode>> 
postBodyFieldNameAndJsonNodes() throws Exception {
+        final JsonNode expectedPostBodyJson = 
objectMapper.readTree(EXPECTED_POST_BODY);
+        final JsonNode actualPostBodyJson = objectMapper.readTree(
+                GraphQLRequestParamUtils.toPostBodyString(new 
GraphQLRequestParams(OPERATION_NAME, QUERY, VARIABLES)));
+        return Stream.of(
+                Triple.of(GraphQLRequestParamUtils.OPERATION_NAME_FIELD, 
expectedPostBodyJson, actualPostBodyJson),
+                Triple.of(GraphQLRequestParamUtils.VARIABLES_FIELD, 
expectedPostBodyJson, actualPostBodyJson),
+                Triple.of(GraphQLRequestParamUtils.QUERY_FIELD, 
expectedPostBodyJson, actualPostBodyJson));
+    }
+
+    @ParameterizedTest
+    @MethodSource("postBodyFieldNameAndJsonNodes")
+    void testToPostBodyString(Triple<String, JsonNode, JsonNode> 
comparisonTriple) throws Exception {
+        final String fieldName = comparisonTriple.getLeft();
+        final JsonNode expectedNode = comparisonTriple.getMiddle();
+        final JsonNode actualNode = comparisonTriple.getRight();

Review comment:
       Please use three different arguments instead of `Triple`




-- 
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: dev-unsubscr...@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to