matrei commented on code in PR #16040:
URL: https://github.com/apache/grails-core/pull/16040#discussion_r3750485665
##########
grails-controllers/src/test/groovy/org/grails/plugins/web/controllers/ControllersAutoConfigurationSpec.groovy:
##########
@@ -54,6 +57,31 @@ class ControllersAutoConfigurationSpec extends Specification
{
def autoConfiguration = new ControllersAutoConfiguration()
+ def "legacy multipart configuration fails startup with migration
instructions"() {
+ given:
+ def applicationContext = new AnnotationConfigWebApplicationContext()
+ applicationContext.servletContext = new MockServletContext()
+ applicationContext.environment.propertySources.addFirst(new
MapPropertySource('test', [
+ 'grails.controllers.upload.maxFileSize': 20000000,
+ ]))
+ applicationContext.register(ControllersAutoConfiguration)
+
+ when:
+ applicationContext.refresh()
+
+ then:
+ def exception = thrown(BeanCreationException)
+ exception.rootCause instanceof IllegalStateException
+ exception.rootCause.message ==
+ "Configuration properties under 'grails.controllers.upload'
are no longer supported. " +
+ "Use Spring Boot's 'spring.servlet.multipart' configuration
instead. For example, set " +
+ "'spring.servlet.multipart.maxFileSize=200MB' and " +
+ "'spring.servlet.multipart.maxRequestSize=200MB'."
+
+ cleanup:
+ applicationContext.close()
+ }
Review Comment:
Should now be addressed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]