Provide an additional test toolkit library for spring framework.
- JUnit 4
@IfProfileValue
profile source enhancement@ProfileValueSourceConfiguration(EnvironmentProfileValueSource.class)
, use environment as profile value source@ProfileValueSourceConfiguration(MergedSystemEnvAndPropertyProfileValueSource.class)
, use environment and system properties as profile value source
- JUnit 4
@RunTestOnWindowsOnly
annotation, restrict JUnit 4 tests running only on windows operation system SpringParametersRunnerFactory
- JUnit 4
@Parameterized
support forSpringRunner
, support run spring test with parameters
- JUnit 4
- hamcrest additional matchers
- JsonPathMatcher.jsonPath(jsonPathExpression, matcher)
- JsonObjectMatcher.isJsonObject()
- JsonArrayMatcher.isJsonArray()
- sprint-test enhanced request matchers
- form()
- matchAll(ResultMatcher... matchers)
- allOf(ResultMatcher... matchers)
- anyOf(ResultMatcher... matchers)
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
dependencies { implementation 'com.github.ahunigel:spring-test-toolkit:{version}' }
Refer to https://jitpack.io/#ahunigel/spring-test-toolkit for details.
@ProfileValueSourceConfiguration(EnvironmentProfileValueSource.class) public class FooTest { }
@ProfileValueSourceConfiguration(MergedSystemEnvAndPropertyProfileValueSource.class) public class FooTest {}
@RunTestOnWindowsOnly public class FooTest {}
@RunWith(Parameterized.class) @Parameterized.UseParametersRunnerFactory(SpringParametersRunnerFactory.class) public class FooTest {}
- hamcrest collection matcher
- hasItemsInOrder
- JsonPath JsonProvider
- NetMinidevJsonProvider