diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfiguration.java index 6ce32747e32b..624fcb67630c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfiguration.java @@ -62,7 +62,7 @@ CodecCustomizer defaultPartHttpMessageReaderCustomizer(ReactiveMultipartProperti .asInt(DataSize::toBytes) .to(defaultPartHttpMessageReader::setMaxHeadersSize); map.from(multipartProperties::getMaxDiskUsagePerPart) - .asInt(DataSize::toBytes) + .as(DataSize::toBytes) .to(defaultPartHttpMessageReader::setMaxDiskUsagePerPart); map.from(multipartProperties::getMaxParts).to(defaultPartHttpMessageReader::setMaxParts); map.from(multipartProperties::getStreaming).to(defaultPartHttpMessageReader::setStreaming); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfigurationTests.java index 9375a9384bac..207a5c273532 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveMultipartAutoConfigurationTests.java @@ -60,7 +60,7 @@ void shouldConfigureMultipartProperties() { this.contextRunner .withPropertyValues("spring.webflux.multipart.streaming:true", "spring.webflux.multipart.max-in-memory-size=1GB", "spring.webflux.multipart.max-headers-size=16KB", - "spring.webflux.multipart.max-disk-usage-per-part=100MB", "spring.webflux.multipart.max-parts=7", + "spring.webflux.multipart.max-disk-usage-per-part=3GB", "spring.webflux.multipart.max-parts=7", "spring.webflux.multipart.headers-charset:UTF_16") .run((context) -> { CodecCustomizer customizer = context.getBean(CodecCustomizer.class); @@ -75,7 +75,7 @@ void shouldConfigureMultipartProperties() { assertThat(partReader).hasFieldOrPropertyWithValue("maxInMemorySize", Math.toIntExact(DataSize.ofGigabytes(1).toBytes())); assertThat(partReader).hasFieldOrPropertyWithValue("maxDiskUsagePerPart", - DataSize.ofMegabytes(100).toBytes()); + DataSize.ofGigabytes(3).toBytes()); }); }