Make it easier to add auto-configuration to a test slice
Previously, an entry had to be added to spring.factories using the name of one of the @AutoConfigure… meta-annotations on the @…Test annotation as the key. This indirection was unnecessarily complicated. This commit simplifies things by allowing the name of the @…Test annotation itself to be used as the key. Closes gh-6335
This commit is contained in:
@@ -18,6 +18,7 @@ package sample.devtools;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -28,6 +29,11 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
@Controller
|
||||
public class MyController {
|
||||
|
||||
@PostConstruct
|
||||
public void slowRestart() throws InterruptedException {
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
public ModelAndView get(HttpSession session) {
|
||||
Object sessionVar = session.getAttribute("var");
|
||||
|
||||
Reference in New Issue
Block a user