Skip to content

Commit ead32c3

Browse files
committed
Merge pull request #436 from Johnny Lim
* gh-436: Polish tests
2 parents caf01d1 + aeb1267 commit ead32c3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldProcessorTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,21 +175,21 @@ public void extractArraysFromItemsInNestedArray() {
175175

176176
@Test(expected = FieldDoesNotExistException.class)
177177
public void nonExistentTopLevelField() {
178-
this.fieldProcessor.extract("a", Collections.emptyMap()).getValue();
178+
this.fieldProcessor.extract("a", Collections.emptyMap());
179179
}
180180

181181
@Test(expected = FieldDoesNotExistException.class)
182182
public void nonExistentNestedField() {
183183
HashMap<String, Object> payload = new HashMap<>();
184184
payload.put("a", new HashMap<String, Object>());
185-
this.fieldProcessor.extract("a.b", payload).getValue();
185+
this.fieldProcessor.extract("a.b", payload);
186186
}
187187

188188
@Test(expected = FieldDoesNotExistException.class)
189189
public void nonExistentNestedFieldWhenParentIsNotAMap() {
190190
HashMap<String, Object> payload = new HashMap<>();
191191
payload.put("a", 5);
192-
this.fieldProcessor.extract("a.b", payload).getValue();
192+
this.fieldProcessor.extract("a.b", payload);
193193
}
194194

195195
@Test(expected = FieldDoesNotExistException.class)
@@ -198,20 +198,20 @@ public void nonExistentFieldWhenParentIsAnArray() {
198198
HashMap<String, Object> alpha = new HashMap<>();
199199
alpha.put("b", Arrays.asList(new HashMap<String, Object>()));
200200
payload.put("a", alpha);
201-
this.fieldProcessor.extract("a.b.c", payload).getValue();
201+
this.fieldProcessor.extract("a.b.c", payload);
202202
}
203203

204204
@Test(expected = FieldDoesNotExistException.class)
205205
public void nonExistentArrayField() {
206206
HashMap<String, Object> payload = new HashMap<>();
207-
this.fieldProcessor.extract("a[]", payload).getValue();
207+
this.fieldProcessor.extract("a[]", payload);
208208
}
209209

210210
@Test(expected = FieldDoesNotExistException.class)
211211
public void nonExistentArrayFieldAsTypeDoesNotMatch() {
212212
HashMap<String, Object> payload = new HashMap<>();
213213
payload.put("a", 5);
214-
this.fieldProcessor.extract("a[]", payload).getValue();
214+
this.fieldProcessor.extract("a[]", payload);
215215
}
216216

217217
@Test(expected = FieldDoesNotExistException.class)
@@ -220,7 +220,7 @@ public void nonExistentFieldBeneathAnArray() {
220220
HashMap<String, Object> alpha = new HashMap<>();
221221
alpha.put("b", Arrays.asList(new HashMap<String, Object>()));
222222
payload.put("a", alpha);
223-
this.fieldProcessor.extract("a.b[].id", payload).getValue();
223+
this.fieldProcessor.extract("a.b[].id", payload);
224224
}
225225

226226
@Test

0 commit comments

Comments
 (0)