@Override protected T doRead() throws Exception { return jsonObjectReader.read(); }
@Override protected void doClose() throws Exception { this.jsonObjectReader.close(); }
@Override protected void doOpen() throws Exception { if (!this.resource.exists()) { if (this.strict) { throw new IllegalStateException("Input resource must exist (reader is in 'strict' mode)"); } LOGGER.warn("Input resource does not exist " + this.resource.getDescription()); return; } if (!this.resource.isReadable()) { if (this.strict) { throw new IllegalStateException("Input resource must be readable (reader is in 'strict' mode)"); } LOGGER.warn("Input resource is not readable " + this.resource.getDescription()); return; } this.jsonObjectReader.open(this.resource); }
@Override protected void doOpen() throws Exception { if (!this.resource.exists()) { if (this.strict) { throw new IllegalStateException("Input resource must exist (reader is in 'strict' mode)"); } LOGGER.warn("Input resource does not exist " + this.resource.getDescription()); return; } if (!this.resource.isReadable()) { if (this.strict) { throw new IllegalStateException("Input resource must be readable (reader is in 'strict' mode)"); } LOGGER.warn("Input resource is not readable " + this.resource.getDescription()); return; } this.jsonObjectReader.open(this.resource); }
@Test public void testReadItem() throws Exception { // given Resource resource = new ByteArrayResource("[]".getBytes()); itemReader = new JsonItemReader<>(resource, this.jsonObjectReader); // when itemReader.read(); // then Mockito.verify(this.jsonObjectReader).read(); }
@Override protected void doClose() throws Exception { this.jsonObjectReader.close(); }
@Override protected T doRead() throws Exception { return jsonObjectReader.read(); }