@RunWith in JUnit5
This commit is contained in:
parent
a6485c4326
commit
7769cde1c6
|
@ -0,0 +1,9 @@
|
|||
package com.baeldung.junit5.mockito;
|
||||
|
||||
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.mockito.Greetings;
|
||||
|
||||
@RunWith(JUnitPlatform.class)
|
||||
public class GreetingsTest {
|
||||
|
||||
@Test
|
||||
void whenCallingSayHello_thenReturnHello() {
|
||||
assertTrue("Hello".equals(Greetings.sayHello()));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue