Skip to content

Commit 09a1258

Browse files
committed
Polishing
1 parent 1f53a55 commit 09a1258

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/GraphQlArgumentInitializerTests.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class GraphQlArgumentInitializerTests {
5050
void defaultConstructor() throws Exception {
5151

5252
Object result = initializer.get().initializeArgument(
53-
environment("{\"key\": { \"name\": \"test\"} }"), "key",
53+
environment("{\"key\":{\"name\":\"test\"}}"), "key",
5454
ResolvableType.forClass(SimpleBean.class));
5555

5656
assertThat(result).isNotNull().isInstanceOf(SimpleBean.class);
@@ -87,7 +87,7 @@ void defaultConstructorWithNestedBeanListProperty() throws Exception {
8787
void defaultConstructorWithNestedBeanListEmpty() throws Exception {
8888

8989
Object result = initializer.get().initializeArgument(
90-
environment("{\"key\": { \"items\": [] } }"), "key",
90+
environment("{\"key\":{\"items\": []}}"), "key",
9191
ResolvableType.forClass(ItemListHolder.class));
9292

9393
assertThat(result).isNotNull().isInstanceOf(ItemListHolder.class);
@@ -134,7 +134,7 @@ void primaryConstructorNotFound() {
134134
assertThatThrownBy(
135135
() -> {
136136
initializer.get().initializeArgument(
137-
environment("{\"key\": { \"name\": \"test\"} }"), "key",
137+
environment("{\"key\":{\"name\":\"test\"}}"), "key",
138138
ResolvableType.forClass(NoPrimaryConstructorBean.class));
139139
})
140140
.isInstanceOf(IllegalStateException.class)
@@ -152,13 +152,23 @@ static class SimpleBean {
152152

153153
String name;
154154

155+
int age;
156+
155157
public String getName() {
156158
return this.name;
157159
}
158160

159161
public void setName(String name) {
160162
this.name = name;
161163
}
164+
165+
public int getAge() {
166+
return this.age;
167+
}
168+
169+
public void setAge(int age) {
170+
this.age = age;
171+
}
162172
}
163173

164174

0 commit comments

Comments
 (0)