demo-junit-5
demo-junit-5 copied to clipboard
Demonstrating JUnit 5 features
Demo of JUnit 5
Demo project accompanying a series of posts exploring JUnit 5.
First Steps
- Setup: have a look at
pom.xmlorbuild.gradle - Basics:
LifecycleTestis a good introduction, for more details see the other classes intest/.../basics - Tests in interfaces in
test/.../interfaces
Next Steps
- Parameter injection: demonstrated in
test/.../injection - Nested tests: demonstrated in
test/.../nested - Parameterized tests: demonstrated in
test/.../parameterized, starting withHelloParams - Dynamic tests: demonstrated in
test/.../dynamic
JUnit 4 and 5
- Architecture (has no code samples)
- Side by side with JUnit 4: configured in
pom.xmlandbuild.gradle(search for 4.12) and demonstrated inLegacyTest - JUnit 4 rules in JUnit Jupiter: demonstrated in JUnit4RuleInJupiter
Extensions
- Extension model: implemented in
mainand used intest/.../extensions - Conditions: implemented in
mainand used intest/.../extensions - Example integrations, e.g. with Mockito, in
test/.../integrations