修复 Debug EML 上传大小限制

This commit is contained in:
andy
2026-07-09 20:16:27 +08:00
parent 666fb41328
commit c190d5e3a8
5 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package cn.nianxx.thhotel.platform.debug.service;
import static org.assertj.core.api.Assertions.assertThat;
import cn.nianxx.thhotel.ThHotelApplication;
import cn.nianxx.thhotel.platform.debug.service.impl.DebugEmlSuperAgentProperties;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.servlet.MultipartProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
@SpringBootTest(
classes = ThHotelApplication.class,
properties = "debug.eml-upload.max-file-bytes=10485760")
@ActiveProfiles("test")
class DebugEmlMultipartConfigurationTest {
@Autowired
private MultipartProperties multipartProperties;
@Autowired
private DebugEmlSuperAgentProperties debugEmlProperties;
@Test
void shouldAllowMultipartRequestBeforeDebugEmlBusinessLimit() {
assertThat(multipartProperties.getMaxFileSize().toBytes())
.isGreaterThanOrEqualTo(debugEmlProperties.getMaxFileBytes());
assertThat(multipartProperties.getMaxRequestSize().toBytes())
.isGreaterThan(debugEmlProperties.getMaxFileBytes());
}
}