Skip to content

bmuschko/junit5-vs-spock-feature-comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JUnit 5 vs. Spock feature comparison Build Status

Covered features

Description JUnit 5 Spock

Test execution

@Test

Specification

Fixture set up and tear down

@BeforeEach, @AfterEach

setup, teardown

Descriptive test names

@DisplayName

Method name as String

Disabling tests

@Disabled

@Ignore

Expecting thrown exceptions

assertThrows

@FailsWith

Repeating test execution

@RepeatedTest

where statement with counter

Declaring timeouts

assertTimeout

@Timeout

Conditional test execution

assumeTrue, ExecutionCondition

@Requires

Data-driven tests

@ParameterizedTest, @MethodSource

where statement with table

Mocking

Mockito

Built-in mock capabilities

Filtering test execution

@Tag

Custom annotations with runner configuration

Extending the test framework

@ExtendWith

@ExtensionAnnotation

Executing the tests

All tests can be executed with the help of Gradle. The project provides a Gradle Wrapper so no installation of the Gradle runtime is needed.

Windows:

> gradlew.bat check

*nix:

$ ./gradlew check

About

Compares JUnit 5 with Spock features by example.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published