File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
spring-batch-infrastructure/src/test/java/org/springframework/batch/item/json Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 24
24
import org .junit .rules .ExpectedException ;
25
25
import org .junit .runner .RunWith ;
26
26
import org .mockito .Mock ;
27
+ import org .mockito .Mockito ;
27
28
import org .mockito .junit .MockitoJUnitRunner ;
28
29
29
30
import org .springframework .batch .item .ExecutionContext ;
30
31
import org .springframework .batch .item .ItemStreamException ;
31
32
import org .springframework .core .io .AbstractResource ;
32
33
import org .springframework .core .io .ByteArrayResource ;
34
+ import org .springframework .core .io .Resource ;
33
35
34
36
import static org .junit .Assert .assertEquals ;
35
37
import static org .junit .Assert .fail ;
@@ -95,6 +97,19 @@ public void testNonReadableResource() {
95
97
// expected exception
96
98
}
97
99
100
+ @ Test
101
+ public void testReadItem () throws Exception {
102
+ // given
103
+ Resource resource = new ByteArrayResource ("[]" .getBytes ());
104
+ itemReader = new JsonItemReader <>(resource , this .jsonObjectReader );
105
+
106
+ // when
107
+ itemReader .read ();
108
+
109
+ // then
110
+ Mockito .verify (this .jsonObjectReader ).read ();
111
+ }
112
+
98
113
private static class NonExistentResource extends AbstractResource {
99
114
100
115
NonExistentResource () {
You can’t perform that action at this time.
0 commit comments