You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`hamcrest-core` is excluded in favor of `org.hamcrest:hamcrest` that is part of `spring-boot-starter-test`.
6274
+
6273
6275
6274
6276
6275
6277
[[boot-features-test-scope-dependencies]]
6276
6278
=== Test Scope Dependencies
6277
6279
The `spring-boot-starter-test` "`Starter`" (in the `test` `scope`) contains the following provided libraries:
6278
6280
6279
-
* https://junit.org/junit5/[JUnit 5] (including the vintage engine for backward compatibility with JUnit 4): The de-facto standard for unit testing Java applications.
6281
+
* https://junit.org/junit5/[JUnit 5]: The de-facto standard for unit testing Java applications.
6280
6282
* {spring-framework-docs}/testing.html#integration-testing[Spring Test] & Spring Boot Test: Utilities and integration test support for Spring Boot applications.
6281
6283
* https://assertj.github.io/doc/[AssertJ]: A fluent assertion library.
6282
6284
* https://github.com/hamcrest/JavaHamcrest[Hamcrest]: A library of matcher objects (also known as constraints or predicates).
@@ -8100,10 +8102,6 @@ While it is possible to use JUnit 4 to test Kotlin code, JUnit 5 is provided by
8100
8102
JUnit 5 enables a test class to be instantiated once and reused for all of the class's tests.
8101
8103
This makes it possible to use `@BeforeClass` and `@AfterClass` annotations on non-static methods, which is a good fit for Kotlin.
8102
8104
8103
-
JUnit 5 is the default and the vintage engine is provided for backward compatibility with JUnit 4.
8104
-
If you don't use it, exclude `org.junit.vintage:junit-vintage-engine`.
8105
-
You also need to {junit5-docs}/#writing-tests-test-instance-lifecycle-changing-default[switch test instance lifecycle to "per-class"].
8106
-
8107
8105
To mock Kotlin classes, https://mockk.io/[MockK] is recommended.
8108
8106
If you need the `Mockk` equivalent of the Mockito specific <<boot-features-testing-spring-boot-applications-mocking-beans,`@MockBean` and `@SpyBean` annotations>>, you can use https://github.com/Ninja-Squad/springmockk[SpringMockK] which provides similar `@MockkBean` and `@SpykBean` annotations.
Copy file name to clipboardExpand all lines: spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/src/main/java/smoketest/MessageController.java
Copy file name to clipboardExpand all lines: spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/src/main/java/smoketest/SampleJUnitJupiterApplication.java
Copy file name to clipboardExpand all lines: spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/src/test/java/smoketest/SampleJUnitJupiterApplicationTests.java
0 commit comments