Object GraphqlBodyMatcher.Companion
-
- All Implemented Interfaces:
public class GraphqlBodyMatcher.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static GraphqlBodyMatcher.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final GraphqlBodyMatcherwithRequestQueryAndVariables(String expectedQuery, String expectedVariables)Creates a new instance of GraphqlBodyMatcher with the given GraphQL query string and variables. final GraphqlBodyMatcherwithRequestJson(String expectedJson)Creates a new instance of GraphqlBodyMatcher with the given raw JSON string containing a GraphQL query and optional variables. final ParameterswithRequest(String expectedJson)Creates a Parameters instance containing the given raw JSON string expected in the GraphQL request. -
-
Method Detail
-
withRequestQueryAndVariables
@Deprecated(message = "This method will be deleted in a future release. Use withRequestJson instead.") final GraphqlBodyMatcher withRequestQueryAndVariables(String expectedQuery, String expectedVariables)
Creates a new instance of GraphqlBodyMatcher with the given GraphQL query string and variables. The query string and variables are wrapped in a JSON object with "query" and "variables" fields, parsed, validated, and normalized before being used for matching.
- Parameters:
expectedQuery- The GraphQL query string that the matcher expects in requests.expectedVariables- The variables associated with the GraphQL query as a JSON string.
-
withRequestJson
final GraphqlBodyMatcher withRequestJson(String expectedJson)
Creates a new instance of GraphqlBodyMatcher with the given raw JSON string containing a GraphQL query and optional variables. The JSON is expected to have a "query" field with the query string and an optional "variables" field containing the variables. The query is parsed, validated, and normalized before being used for matching.
- Parameters:
expectedJson- The raw JSON string containing the GraphQL query and optional variables that the matcher expects in requests.
-
withRequest
final Parameters withRequest(String expectedJson)
Creates a Parameters instance containing the given raw JSON string expected in the GraphQL request.
This method is used to set up JSON expected in remote requests. The expectedJson parameter should be a raw JSON string that encapsulates the expected query and optionally variables for the GraphQL request. This string is used to create a parameters object utilized internally in the GraphqlBodyMatcher.
- Parameters:
expectedJson- A raw JSON string that contains the GraphQL query and optionally variables expected in the requests.
-
-
-
-