diff --git a/src/test/java/git/tracehub/codereview/action/github/AuthoredTest.java b/src/test/java/git/tracehub/codereview/action/github/AuthoredTest.java index acc7e6c..0d22dc2 100644 --- a/src/test/java/git/tracehub/codereview/action/github/AuthoredTest.java +++ b/src/test/java/git/tracehub/codereview/action/github/AuthoredTest.java @@ -26,6 +26,7 @@ import java.io.InputStreamReader; import java.util.List; import javax.json.Json; +import javax.json.JsonArray; import org.cactoos.io.ResourceOf; import org.cactoos.list.ListOf; import org.hamcrest.MatcherAssert; @@ -36,13 +37,12 @@ * Test case for {@link Authored}. * * @since 0.0.0 - * @checkstyle StringLiteralsConcatenationCheck (30 lines) */ final class AuthoredTest { @Test void collectsAllComments() throws Exception { - final List comments = new Authored( + final JsonArray comments = new Authored( () -> Json.createReader( new InputStreamReader( new ResourceOf( @@ -51,12 +51,13 @@ void collectsAllComments() throws Exception { ) ).readArray() ).value(); - final List expected = new ListOf<>( - "h1alexbel: @hizmailovich first comment", - "h1alexbel: @hizmailovich second comment", - "h1alexbel: @hizmailovich This sentence might be connected with the" - + " previous one: \"The subject of this article is caching.\"" - ); + final JsonArray expected = Json.createReader( + new InputStreamReader( + new ResourceOf( + "git/tracehub/codereview/action/github/with-comments.json" + ).stream() + ) + ).readArray(); MatcherAssert.assertThat( String.format( "Received comments (%s) do not match with expected (%s)", diff --git a/src/test/resources/git/tracehub/codereview/action/github/with-comments.json b/src/test/resources/git/tracehub/codereview/action/github/with-comments.json new file mode 100644 index 0000000..a42b7f3 --- /dev/null +++ b/src/test/resources/git/tracehub/codereview/action/github/with-comments.json @@ -0,0 +1,5 @@ +[ + "h1alexbel: @hizmailovich first comment", + "h1alexbel: @hizmailovich second comment", + "h1alexbel: @hizmailovich This sentence might be connected with the previous one: \"The subject of this article is caching.\"" +]