修复 Debug EML 上传大小限制
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user