优化
This commit is contained in:
+29
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user