diff --git a/java-strings-3/src/main/java/com/baeldung/string/wordcount/WordCounter.java b/java-strings-3/src/main/java/com/baeldung/string/wordcount/WordCounter.java index 1ee7e4a4ef..85d0efd242 100644 --- a/java-strings-3/src/main/java/com/baeldung/string/wordcount/WordCounter.java +++ b/java-strings-3/src/main/java/com/baeldung/string/wordcount/WordCounter.java @@ -3,10 +3,6 @@ package com.baeldung.string.wordcount; import java.util.StringTokenizer; public class WordCounter { - public static void main(String[] args) { - - } - public static int countWordsUsingRegex(String arg) { if (arg == null) { return 0; diff --git a/java-strings-3/src/test/java/com/baeldung/string/wordcount/WordCountUnitTest.java b/java-strings-3/src/test/java/com/baeldung/string/wordcount/WordCountUnitTest.java index a8f6a37434..19e13572b7 100644 --- a/java-strings-3/src/test/java/com/baeldung/string/wordcount/WordCountUnitTest.java +++ b/java-strings-3/src/test/java/com/baeldung/string/wordcount/WordCountUnitTest.java @@ -1,6 +1,6 @@ package com.baeldung.string.wordcount; -import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; import org.junit.Test; public class WordCountUnitTest { @@ -9,16 +9,16 @@ public class WordCountUnitTest { @Test public void givenStringWith8Words_whenUsingRegexCount_ThenResultEqual8() { - assertThat(WordCounter.countWordsUsingRegex(string2) == 8).isTrue(); + assertEquals(8, WordCounter.countWordsUsingRegex(string2)); } @Test public void givenStringWith8Words_whenUsingManualMethod_ThenWordCountEqual8() { - assertThat(WordCounter.countWordsManually(string1) == 8).isTrue(); + assertEquals(8, WordCounter.countWordsManually(string1)); } @Test public void givenAStringWith8Words_whenUsingTokenizer_ThenWordCountEqual8() { - assertThat(WordCounter.countWordsUsingTokenizer(string1) == 8).isTrue(); + assertEquals(8, WordCounter.countWordsUsingTokenizer(string1)); } }