This commit is contained in:
2026-08-21 10:43:25 +08:00
parent d5e9ba6d4c
commit e17f03e596
55 changed files with 775 additions and 173 deletions
@@ -0,0 +1,28 @@
package com.baiyue.gateway.config;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import static org.assertj.core.api.Assertions.assertThat;
class OverseasLastlegRouteContractTest {
@Test
void platformDispatchPathIsForwardedToLastlegWithoutPrefixRewrite() throws IOException {
try (InputStream input = getClass().getResourceAsStream("/application-overseas.yml")) {
assertThat(input).isNotNull();
String yaml = new String(input.readAllBytes(), StandardCharsets.UTF_8);
int routeStart = yaml.indexOf("- id: lastleg-service");
int routeEnd = yaml.indexOf("- id: warehouse-overseas-service", routeStart);
assertThat(routeStart).isGreaterThanOrEqualTo(0);
assertThat(routeEnd).isGreaterThan(routeStart);
String route = yaml.substring(routeStart, routeEnd);
assertThat(route).contains("uri: lb://lastleg-service")
.contains("/api/platform/v1/last-leg/**")
.doesNotContain("StripPrefix", "RewritePath");
}
}
}