diff --git a/src/shared/config.ts b/src/shared/config.ts index 1ff3648..9bab31a 100644 --- a/src/shared/config.ts +++ b/src/shared/config.ts @@ -5,7 +5,7 @@ export const config = { url: process.env.KEYCLOAK_URL ?? 'https://keycloak.akhr-ai.com', realm: process.env.KEYCLOAK_REALM ?? 'corp', clientId: process.env.KEYCLOAK_CLIENT_ID ?? 'api-gateway', - clientSecret: process.env.KEYCLOAK_CLIENT_SECRET, // 只从环境读,无缺省;data-service 恒无 + clientSecret: process.env.KEYCLOAK_CLIENT_SECRET, // 只从环境读,无缺省 }, agentServiceUrl: process.env.AGENT_SERVICE_URL ?? 'http://127.0.0.1:8901', taskServiceUrl: process.env.TASK_SERVICE_URL ?? 'http://127.0.0.1:8801', diff --git a/test/unit/health.test.ts b/test/unit/health.test.ts index 093daa1..bf87a28 100644 --- a/test/unit/health.test.ts +++ b/test/unit/health.test.ts @@ -6,6 +6,7 @@ vi.mock('../../src/shared/bus/nats', () => ({ })); import { buildApp } from '../../src/app/app'; +import { config } from '../../src/shared/config'; describe('health', () => { it('nats 探活 ok(mock)时返回 200', async () => { @@ -17,7 +18,9 @@ describe('health', () => { checks: Record; }; expect(body.ok).toBe(true); - expect(body.service).toMatch(/^bpos-service-/); + expect(body.service).toBe('bpos-service-gateway'); + expect(config.port).toBe(8800); + expect(config.keycloak.clientId).toBe('api-gateway'); expect(body.checks['nats']).toBe('ok'); }); });