Switch focus to JUnit Jupiter in testing examples

This commit is contained in:
Sam Brannen
2022-05-15 19:34:07 +02:00
parent 0fb0335aa0
commit bf8a54decf
2 changed files with 10 additions and 10 deletions

View File

@@ -356,16 +356,16 @@ import org.springframework.stereotype.Component;
* {@code @Component} classes.
*
* <pre class="code">
* &#064;RunWith(SpringRunner.class)
* &#064;ExtendWith(SpringExtension.class)
* &#064;ContextConfiguration(classes = {AppConfig.class, DatabaseConfig.class})
* public class MyTests {
* class MyTests {
*
* &#064;Autowired MyBean myBean;
*
* &#064;Autowired DataSource dataSource;
*
* &#064;Test
* public void test() {
* void test() {
* // assertions against myBean ...
* }
* }</pre>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,16 +42,16 @@ import java.lang.annotation.Target;
* the one for the child context (i.e., the lowest context in the hierarchy).
*
* <pre class="code">
* &#064;RunWith(SpringRunner.class)
* &#064;ExtendWith(SpringExtension.class)
* &#064;WebAppConfiguration
* &#064;ContextHierarchy({
* &#064;ContextConfiguration(classes = TestAppConfig.class),
* &#064;ContextConfiguration(classes = WebConfig.class)
* })
* public class ControllerIntegrationTests {
* class ControllerIntegrationTests {
*
* &#064;Autowired
* private WebApplicationContext wac;
* WebApplicationContext wac;
*
* // ...
* }</pre>
@@ -71,7 +71,7 @@ import java.lang.annotation.Target;
* the parent context for each of the contexts loaded for the concrete subclasses.
*
* <pre class="code">
* &#064;RunWith(SpringRunner.class)
* &#064;ExtendWith(SpringExtension.class)
* &#064;WebAppConfiguration
* &#064;ContextConfiguration("file:src/main/webapp/WEB-INF/applicationContext.xml")
* public abstract class AbstractWebTests {}
@@ -98,7 +98,7 @@ import java.lang.annotation.Target;
* "/order-config.xml"}</code>.
*
* <pre class="code">
* &#064;RunWith(SpringRunner.class)
* &#064;ExtendWith(SpringExtension.class)
* &#064;ContextHierarchy({
* &#064;ContextConfiguration(name = "parent", locations = "/app-config.xml"),
* &#064;ContextConfiguration(name = "child", locations = "/user-config.xml")
@@ -119,7 +119,7 @@ import java.lang.annotation.Target;
* context loaded from {@code "/app-config.xml"}.
*
* <pre class="code">
* &#064;RunWith(SpringRunner.class)
* &#064;ExtendWith(SpringExtension.class)
* &#064;ContextHierarchy({
* &#064;ContextConfiguration(name = "parent", locations = "/app-config.xml"),
* &#064;ContextConfiguration(name = "child", locations = "/user-config.xml")