Skip to content

Commit

Permalink
Mockito.spy cannot work on final objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
Capstan committed Sep 6, 2019
1 parent da3a32f commit 3f3a2dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/java/com/github/fge/jackson/JsonNodeReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final class JsonNodeReaderTest
public void streamIsClosedOnRead()
throws IOException
{
final Supplier<InputStream> supplier = provideInputStream("[]");
Supplier<InputStream> supplier = provideInputStream("[]");
final InputStream in = spy(supplier.get());
final JsonNode node = new JsonNodeReader().fromInputStream(in);
verify(in).close();
Expand All @@ -61,7 +61,7 @@ public void streamIsClosedOnRead()
public void readerIsClosedOnRead()
throws IOException
{
final Supplier<Reader> supplier = provideReader("[]");
Supplier<Reader> supplier = provideReader("[]");
final Reader reader = spy(supplier.get());
final JsonNode node = new JsonNodeReader().fromReader(reader);
assertEquals(node, new ObjectMapper().readTree(supplier.get()));
Expand Down

0 comments on commit 3f3a2dd

Please sign in to comment.