fix(gateway): route /locale/** to services-system

The language registry answered 404 through the gateway, so the public
language list failed with a 500. Found in the live check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-02 13:26:16 +08:00
1 parent a73614424e
commit 48a6180c0a
3 files changed
+34 -1

No files matched your search

@@ -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;
/** add-zh-cn-messages: mobile-api reaches services-system's /locale/* language registry through the gateway. */
class LocaleRouteTest {
@Test
@SuppressWarnings("unchecked")
void localePathsRouteToServicesSystem() 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=/locale/**");
});
}
}
}