@RunWith in JUnit5

This commit is contained in:
Marcos 2017-11-01 15:18:13 +01:00
parent a6485c4326
commit 7769cde1c6
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,9 @@
package com.baeldung.junit5.mockito;
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.mockito.Greetings;
@RunWith(JUnitPlatform.class)
public class GreetingsTest {
@Test
void whenCallingSayHello_thenReturnHello() {
assertTrue("Hello".equals(Greetings.sayHello()));
}
}