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