This commit is contained in:
2026-08-11 10:45:53 +08:00
parent 4e79287a35
commit e4372783d0
13 changed files with 758 additions and 42 deletions
@@ -0,0 +1,33 @@
package com.baiyue.gateway.config;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import java.nio.charset.StandardCharsets;
import static org.assertj.core.api.Assertions.assertThat;
class FinanceRouteContractTest {
@Test
void routesOnlyTheConfirmedFinanceApiPrefixes() throws Exception {
String yaml = new ClassPathResource("application.yml")
.getContentAsString(StandardCharsets.UTF_8);
assertThat(yaml)
.contains("uri: lb://finance-service")
.contains("/api/platform/finance/v1/**")
.contains("/api/client/finance/v1/**")
.doesNotContain("/api/platform/v1/finance")
.doesNotContain("/api/merchant/v1/finance");
}
@Test
void exposesFinanceSwaggerAggregationRoute() throws Exception {
String yaml = new ClassPathResource("application.yml")
.getContentAsString(StandardCharsets.UTF_8);
assertThat(yaml)
.contains("/finance-service/v3/api-docs/**")
.contains("url: /finance-service/v3/api-docs");
}
}