Skip to content

Commit

Permalink
feat(#2): AuthoredTest fix
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Apr 1, 2024
1 parent d58bca7 commit c566b36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<String> comments = new Authored(
final JsonArray comments = new Authored(
() -> Json.createReader(
new InputStreamReader(
new ResourceOf(
Expand All @@ -51,12 +51,13 @@ void collectsAllComments() throws Exception {
)
).readArray()
).value();
final List<String> 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)",
Expand Down
Original file line number Diff line number Diff line change
@@ -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.\""
]

0 comments on commit c566b36

Please sign in to comment.