Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/src/main/java/simpleapp/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

public class App {


public String getGreeting() {
return "Hello World!";
return "Hello!";
}

public String getAnotherGreeting() {
Expand All @@ -16,6 +15,8 @@ public String getAnotherGreeting() {

public static void main(String[] args) {
System.out.println(new App().getGreeting());
System.out.println(new App().getGreeting());
System.out.println(new App().getAnotherGreeting());
System.out.println(new App().getAnotherGreeting());
}
}
10 changes: 8 additions & 2 deletions app/src/test/java/simpleapp/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
import static org.junit.jupiter.api.Assertions.*;

class AppTest {

App classUnderTest = new App();

@Test
void appHasAGreeting() {
App classUnderTest = new App();
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
}

@Test
void appHasAnotherGreeting() {
App classUnderTest = new App();
assertNotNull(classUnderTest.getAnotherGreeting(), "app should have a second greeting");
}

@Test
void test1() {
assertEquals(classUnderTest.getAnotherGreeting(), "Greetings!");
}
}