@RunWith in JUnit5 (#2935)

* @RunWith in JUnit5

* Greetings class moved to com.baeldung.junit5 package
This commit is contained in:
Marcos Lopez Gonzalez 2017-11-02 22:42:33 +01:00 committed by Grzegorz Piwowarek
parent 52eb1380b6
commit 9414864a46
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,9 @@
package com.baeldung.junit5;
public class Greetings {
public static String sayHello() {
return "Hello";
}
}

View File

@ -0,0 +1,19 @@
package com.baeldung;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import com.baeldung.junit5.Greetings;
@RunWith(JUnitPlatform.class)
public class GreetingsTest {
@Test
void whenCallingSayHello_thenReturnHello() {
assertTrue("Hello".equals(Greetings.sayHello()));
}
}