Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Sep 11, 2024
1 parent 6bbbac4 commit ab33054
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public final void writeJsonWithoutCloseTo(OutputStream output) throws IOExceptio
try (JsonSerializer serializer = new JsonSerializer(generator)) {
serializer.writeMessageValue(this);
}
;
}

/** Marshals into the {@link OutputStream} in proto JSON format. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ void testToString() throws IOException {
@Test
void errorWriting() throws IOException {
Marshaler marshaler = mock(Marshaler.class);
Mockito.doThrow(new IOException("test")).when(marshaler).writeJsonTo(any(OutputStream.class));
Mockito.doThrow(new IOException("test"))
.when(marshaler)
.writeJsonWithoutCloseTo(any(OutputStream.class));

StreamJsonWriter writer = new StreamJsonWriter(System.out, "type");
writer.write(marshaler);
Expand Down

0 comments on commit ab33054

Please sign in to comment.