From ee2a50bc503c73a1e45bd76390e32d3c8ed251e5 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Thu, 29 Aug 2024 08:58:57 +0300 Subject: [PATCH] tests fixed --- src/test/java/hangman/MainTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/java/hangman/MainTest.java b/src/test/java/hangman/MainTest.java index d0cc008..7e9d6c9 100644 --- a/src/test/java/hangman/MainTest.java +++ b/src/test/java/hangman/MainTest.java @@ -16,9 +16,9 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; -import org.junit.Test; +import org.hamcrest.MatcherAssert; +import org.hamcrest.Matchers; +import org.junit.jupiter.api.Test; public final class MainTest { @@ -29,7 +29,10 @@ public void failsAfterManyWrongAttempts() throws Exception { ); final ByteArrayOutputStream output = new ByteArrayOutputStream(); new Main(input, output, 1).exec(); - assertThat(output.toString(), containsString("You lost")); + MatcherAssert.assertThat( + output.toString(), + Matchers.containsString("You lost") + ); } }