fix: correct application cmpp credentials

This commit is contained in:
hectorzhao
2026-07-09 17:18:39 +08:00
parent 57a4c86a79
commit 767f0ca9aa
13 changed files with 149 additions and 24 deletions
+12 -1
View File
@@ -9,6 +9,7 @@ function createPrismaMock() {
name: '应用A',
status: 'active',
cmppAccount: '100001',
cmppEnterpriseCode: 'APP-EC',
cmppMaxConnections: 2,
cmppWindowSize: 32,
queuePriority: 'normal',
@@ -21,10 +22,11 @@ function createPrismaMock() {
name: '应用A',
status: 'active',
cmppAccount: '100001',
cmppEnterpriseCode: 'APP-EC',
cmppMaxConnections: 2,
cmppWindowSize: 32,
queuePriority: 'normal',
secretHash: 'secret-hash',
secretHash: '0123456789abcdef',
tenant: { id: 'tenant-1', name: '租户A', code: 'TENANT-A' },
}),
update: jest.fn().mockImplementation(({ data }) => Promise.resolve({ id: 'app-1', tenantId: 'tenant-1', ...data })),
@@ -109,6 +111,9 @@ function createPrismaMock() {
operationLog: {
create: jest.fn(),
},
tenant: {
findUnique: jest.fn().mockResolvedValue({ code: 'TENANT-A' }),
},
$transaction: jest.fn((callback) => callback({
smsApplication: {
update: jest.fn().mockImplementation(({ data }) => Promise.resolve({ id: 'app-1', tenantId: 'tenant-1', ...data })),
@@ -171,6 +176,8 @@ describe('SmsConfigService', () => {
applicationId: 'app-1',
tenantName: '租户A',
account: '100001',
enterpriseCode: 'APP-EC',
passwordCipher: '0123456789abcdef',
gatewayHost: '127.0.0.1',
gatewayPort: 17890,
maxConnections: 2,
@@ -187,6 +194,8 @@ describe('SmsConfigService', () => {
tenantId: 'tenant-1',
name: '优先应用',
cmppAccount: '123456',
cmppEnterpriseCode: 'CUSTOM-EC',
passwordCipher: '1234567890abcdef',
cmppMaxConnections: 3,
cmppWindowSize: 32,
queuePriority: 'priority',
@@ -198,6 +207,8 @@ describe('SmsConfigService', () => {
tenantId: 'tenant-1',
name: '优先应用',
cmppAccount: '123456',
cmppEnterpriseCode: 'CUSTOM-EC',
secretHash: '1234567890abcdef',
cmppMaxConnections: 3,
cmppWindowSize: 32,
queuePriority: 'priority',