Polishing contribution

Closes gh-176
This commit is contained in:
Rossen Stoyanchev
2021-11-03 17:24:26 +00:00
parent a06ebdcd9c
commit 5aac81c003
2 changed files with 4 additions and 3 deletions

View File

@@ -170,7 +170,8 @@ public interface GraphQlTester {
/**
* Add a variable.
* @param name the variable name
* @param value the variable value
* @param value the variable value, possibly {@code null} since GraphQL
* supports providing null value vs not providing a value at all.
* @return this request spec
*/
T variable(String name, @Nullable Object value);

View File

@@ -179,7 +179,7 @@ public class GraphQlTesterTests {
.operationName("HeroNameAndFriends")
.variable("episode", "JEDI")
.variable("foo", "bar")
.variable("optional", null)
.variable("keyOnly", null)
.execute();
spec.path("hero").entity(MovieCharacter.class).isEqualTo(MovieCharacter.create("R2-D2"));
@@ -190,7 +190,7 @@ public class GraphQlTesterTests {
assertThat(input.getVariables()).hasSize(3);
assertThat(input.getVariables()).containsEntry("episode", "JEDI");
assertThat(input.getVariables()).containsEntry("foo", "bar");
assertThat(input.getVariables()).containsEntry("optional", null);
assertThat(input.getVariables()).containsEntry("keyOnly", null);
}
@Test