fix: route /company/** through the gateway to services-system

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-11-30 20:38:01 +08:00
1 parent bb9d4357af
commit 8f80f52c04
2 files changed
+32

No files matched your search

@@ -152,6 +152,10 @@ spring:
uri: http://${app.services.name.system}
predicates:
- Path=/loginSecurity/**
- id: company
uri: http://${app.services.name.system}
predicates:
- Path=/company/**
- id: passwordAging
uri: http://${app.services.name.system}
predicates:
@@ -0,0 +1,28 @@
package com.solvway.gateway;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.Yaml;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
/** mobile-api reaches services-system's /company/* endpoints through the gateway. */
class CompanyRouteTest {
@Test
@SuppressWarnings("unchecked")
void companyPathsRouteToServicesSystem() throws Exception {
try (InputStream in = getClass().getResourceAsStream("/application.yml")) {
Map<String, Object> yml = new Yaml().load(in);
Map<String, Object> gateway = (Map<String, Object>) ((Map<String, Object>) ((Map<String, Object>) yml.get("spring")).get("cloud")).get("gateway");
List<Map<String, Object>> routes = (List<Map<String, Object>>) gateway.get("routes");
assertThat(routes).anySatisfy(r -> {
assertThat(r.get("uri")).isEqualTo("http://${app.services.name.system}");
assertThat((List<String>) r.get("predicates")).contains("Path=/company/**");
});
}
}
}