Skip to content

Instantly share code, notes, and snippets.

@luksrn
Last active April 20, 2017 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luksrn/952a3f19ecec1d28ba59c6e16914076b to your computer and use it in GitHub Desktop.
Save luksrn/952a3f19ecec1d28ba59c6e16914076b to your computer and use it in GitHub Desktop.
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
@Tag("fast")
class FirstTest {
@Test
@DisplayName("My 1st JUnit 5 test! 😎")
void myFirstTest(TestInfo testInfo) {
Calculator calculator = new Calculator();
assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2");
assertEquals("My 1st JUnit 5 test! 😎", testInfo.getDisplayName(), () -> "TestInfo is injected correctly");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment