From 4b2318338f8534f06f8819ff0f7b79bf838f6beb Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Sat, 16 Nov 2024 20:23:43 -0800 Subject: [PATCH] fix tests --- .../grails/boot/EmbeddedContainerWithGrailsSpec.groovy | 6 ++---- .../groovy/grails/boot/GrailsSpringApplicationSpec.groovy | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/grails-web-boot/src/test/groovy/grails/boot/EmbeddedContainerWithGrailsSpec.groovy b/grails-web-boot/src/test/groovy/grails/boot/EmbeddedContainerWithGrailsSpec.groovy index ef225586026..729cb09440f 100644 --- a/grails-web-boot/src/test/groovy/grails/boot/EmbeddedContainerWithGrailsSpec.groovy +++ b/grails-web-boot/src/test/groovy/grails/boot/EmbeddedContainerWithGrailsSpec.groovy @@ -3,12 +3,11 @@ package grails.boot import grails.artefact.Artefact import grails.boot.config.GrailsAutoConfiguration import grails.web.Controller +import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration -import org.springframework.web.servlet.config.annotation.EnableWebMvc import spock.lang.Specification /** @@ -32,8 +31,7 @@ class EmbeddedContainerWithGrailsSpec extends Specification { new URL("http://localhost:${context.webServer.port}/foos").text == 'all foos' } - @Configuration - @EnableWebMvc + @SpringBootApplication static class Application extends GrailsAutoConfiguration { @Bean ConfigurableServletWebServerFactory webServerFactory() { diff --git a/grails-web-boot/src/test/groovy/grails/boot/GrailsSpringApplicationSpec.groovy b/grails-web-boot/src/test/groovy/grails/boot/GrailsSpringApplicationSpec.groovy index 7581b22ed9f..d02c981a27a 100644 --- a/grails-web-boot/src/test/groovy/grails/boot/GrailsSpringApplicationSpec.groovy +++ b/grails-web-boot/src/test/groovy/grails/boot/GrailsSpringApplicationSpec.groovy @@ -2,13 +2,11 @@ package grails.boot import grails.boot.config.GrailsAutoConfiguration import org.springframework.boot.SpringApplication +import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory -import org.springframework.context.ConfigurableApplicationContext import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration -import org.springframework.web.servlet.config.annotation.EnableWebMvc import spock.lang.Specification /** @@ -34,8 +32,7 @@ class GrailsSpringApplicationSpec extends Specification{ } - @Configuration - @EnableWebMvc + @SpringBootApplication static class Application extends GrailsAutoConfiguration { @Bean ConfigurableServletWebServerFactory webServerFactory() {