update
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
const NATSBridge = require('../src/natsbridge.js');
|
||||
const crypto = require('crypto');
|
||||
|
||||
const TEST_BROKER_URL = process.env.NATS_URL || 'nats://localhost:4222';
|
||||
const TEST_FILESERVER_URL = process.env.FILESERVER_URL || 'http://localhost:8080';
|
||||
@@ -18,15 +19,15 @@ async function runTest() {
|
||||
const mixedDict = { string: 'text', number: 123, boolean: true, null_val: null };
|
||||
|
||||
const testData = {
|
||||
correlation_id: 'test-receiver-dict-' + Date.now(),
|
||||
msg_id: 'msg-' + Date.now(),
|
||||
correlation_id: 'test-receiver-dict-' + crypto.randomUUID(),
|
||||
msg_id: 'msg-' + crypto.randomUUID(),
|
||||
timestamp: new Date().toISOString(),
|
||||
send_to: '/test/dictionary',
|
||||
msg_purpose: 'test',
|
||||
sender_name: 'js-dict-test',
|
||||
sender_id: 'sender-' + Date.now(),
|
||||
sender_id: 'sender-' + crypto.randomUUID(),
|
||||
receiver_name: 'js-receiver',
|
||||
receiver_id: 'receiver-' + Date.now(),
|
||||
receiver_id: 'receiver-' + crypto.randomUUID(),
|
||||
reply_to: '',
|
||||
reply_to_msg_id: '',
|
||||
broker_url: TEST_BROKER_URL,
|
||||
@@ -161,15 +162,15 @@ async function runTest() {
|
||||
// Test round-trip with receive
|
||||
console.log('\n=== Round-trip Test ===');
|
||||
const roundTripData = {
|
||||
correlation_id: 'roundtrip-' + Date.now(),
|
||||
msg_id: 'msg-' + Date.now(),
|
||||
correlation_id: 'roundtrip-' + crypto.randomUUID(),
|
||||
msg_id: 'msg-' + crypto.randomUUID(),
|
||||
timestamp: new Date().toISOString(),
|
||||
send_to: '/test/dictionary',
|
||||
msg_purpose: 'test',
|
||||
sender_name: 'js-test',
|
||||
sender_id: 'sender-' + Date.now(),
|
||||
sender_id: 'sender-' + crypto.randomUUID(),
|
||||
receiver_name: 'js-receiver',
|
||||
receiver_id: 'receiver-' + Date.now(),
|
||||
receiver_id: 'receiver-' + crypto.randomUUID(),
|
||||
reply_to: '',
|
||||
reply_to_msg_id: '',
|
||||
broker_url: TEST_BROKER_URL,
|
||||
|
||||
Reference in New Issue
Block a user