@RunWith in JUnit5 (#2935)
* @RunWith in JUnit5 * Greetings class moved to com.baeldung.junit5 package
This commit is contained in:
parent
52eb1380b6
commit
9414864a46
|
@ -0,0 +1,9 @@
|
|||
package com.baeldung.junit5;
|
||||
|
||||
public class Greetings {
|
||||
|
||||
public static String sayHello() {
|
||||
return "Hello";
|
||||
}
|
||||
|
||||
}
|
|
@ -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()));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue