This commit is contained in:
2026-08-28 12:33:14 +08:00
parent f998bed09c
commit fe68551124
5 changed files with 63 additions and 0 deletions
@@ -0,0 +1,29 @@
package com.baiyue.lastleg.inboundplan.pda;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import static org.assertj.core.api.Assertions.assertThat;
class ReceivingPhotoUploadConfigurationContractTest {
@Test
void lastlegAcceptsTheSameTenMegabyteLimitAsFileService() throws Exception {
String application = read("lastleg-service/src/main/resources/application.yml");
String overseas = read("config/nacos/overseas/lastleg-service.yml");
for (String configuration : new String[]{application, overseas}) {
assertThat(configuration).contains(
"max-file-size: ${LASTLEG_MULTIPART_MAX_FILE_SIZE:10MB}",
"max-request-size: ${LASTLEG_MULTIPART_MAX_REQUEST_SIZE:11MB}");
}
}
private static String read(String relative) throws Exception {
Path path = Path.of(relative);
if (!Files.exists(path)) path = Path.of("..").resolve(relative);
return Files.readString(path, StandardCharsets.UTF_8);
}
}