Skip to content

Commit eb265c4

Browse files
committed
Added correlation_id fallback strategy test
1 parent 75a41b6 commit eb265c4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/test-config.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ describe('Test config', function () {
3636
next = function () {};
3737

3838
req = {};
39-
req.header = function (header) {
40-
return this.headers[header];
41-
};
42-
req.getHeader = req.header;
4339

4440
req.connection = {};
4541
req.headers = {};
@@ -97,7 +93,16 @@ describe('Test config', function () {
9793
logObject.remote_host.should.equal("1.2.3.4");
9894
logObject.remote_port.should.equal("8080");
9995
});
96+
97+
it('Test correlation_id fallback', function () {
98+
req.headers["x-vcap-request-id"] = "test123";
99+
httpLogger.logNetwork(req, res, next);
100+
fireLog();
101+
102+
logObject.request_id.should.equal("test123");
103+
logObject.correlation_id.should.equal("test123");
100104

105+
});
101106

102107

103108
it('Test HTTP header propagation', function () {

0 commit comments

Comments
 (0)