diff --git a/days/day007/src/main/java/com/thegreatapi/ahundreddaysofjava/day007/Day007.java b/days/day007/src/main/java/com/thegreatapi/ahundreddaysofjava/day007/Day007.java new file mode 100644 index 0000000..d2254b3 --- /dev/null +++ b/days/day007/src/main/java/com/thegreatapi/ahundreddaysofjava/day007/Day007.java @@ -0,0 +1,16 @@ +package com.thegreatapi.ahundreddaysofjava.day007; + +import java.text.MessageFormat; + +public class Day007 { + + public static void main(String[] args) { + showMessage("Java", "is", "great"); + } + + public static void showMessage(String param1, String param2, String param3) { + String message = MessageFormat.format("This message contains 3 parameters. The #1 is ''{0}'', the #2 is ''{1}'', and the #3 is ''{2}''.", + param1, param2, param3); + System.out.println(message); + } +} diff --git a/days/day007/src/test/java/com/thegreatapi/ahundreddaysofjava/day007/Day007Test.java b/days/day007/src/test/java/com/thegreatapi/ahundreddaysofjava/day007/Day007Test.java index 8a4dd9c..50258db 100644 --- a/days/day007/src/test/java/com/thegreatapi/ahundreddaysofjava/day007/Day007Test.java +++ b/days/day007/src/test/java/com/thegreatapi/ahundreddaysofjava/day007/Day007Test.java @@ -5,7 +5,6 @@ import java.text.MessageFormat; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.AfterEach; -import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -36,7 +35,6 @@ void shouldFormatMessageCorrectly() { String expectedMessage = "This message contains 3 parameters. The #1 is" + " 'Hello', the #2 is 'World', and the #3 is 'Java'."; assertThat(actualMessage).isEqualTo(expectedMessage); - //assertEquals(expectedMessage, outputStreamCaptor.toString().trim()); } @AfterEach