feat: 添加对 Kafka CurrentStatus 的 restart 值支持,更新 G5 入库逻辑及相关测试
This commit is contained in:
@@ -26,13 +26,19 @@ describe('Processor Logic', () => {
|
||||
expect(rows[0].reboot_reason).toBeNull();
|
||||
});
|
||||
|
||||
it('should override current_status to on for reboot data', () => {
|
||||
const rows = buildRowsFromPayload({ ...basePayload, CurrentStatus: 'off', RebootReason: '0x01' });
|
||||
it('should preserve restart current_status for reboot data', () => {
|
||||
const rows = buildRowsFromPayload({ ...basePayload, CurrentStatus: 'restart', RebootReason: '0x01' });
|
||||
expect(rows).toHaveLength(1);
|
||||
expect(rows[0].current_status).toBe('on');
|
||||
expect(rows[0].current_status).toBe('restart');
|
||||
expect(rows[0].reboot_reason).toBe('0x01');
|
||||
});
|
||||
|
||||
it('should preserve restart current_status for non-reboot data', () => {
|
||||
const rows = buildRowsFromPayload({ ...basePayload, CurrentStatus: 'restart', RebootReason: null });
|
||||
expect(rows).toHaveLength(1);
|
||||
expect(rows[0].current_status).toBe('restart');
|
||||
});
|
||||
|
||||
it('should keep empty optional fields as empty strings', () => {
|
||||
const rows = buildRowsFromPayload({
|
||||
...basePayload,
|
||||
|
||||
Reference in New Issue
Block a user