-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: finish up the rdkafka event pattern
- Loading branch information
1 parent
1219546
commit cabfd40
Showing
14 changed files
with
393 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,54 @@ describe('RdKafka transport', function () { | |
await app.init(); | ||
}); | ||
|
||
it(`/POST (async event notification)`, done => { | ||
request(server) | ||
.post('/notify') | ||
.send() | ||
.end(() => { | ||
setTimeout(() => { | ||
expect(RdKafkaController.IS_NOTIFIED).to.be.true; | ||
done(); | ||
}, 1000); | ||
}); | ||
}); | ||
|
||
it(`/POST (async event notification with key)`, done => { | ||
request(server) | ||
.post('/notifyWithKey') | ||
.send() | ||
.end(() => { | ||
setTimeout(() => { | ||
expect(RdKafkaController.IS_NOTIFIED_WITH_KEY).to.be.true; | ||
done(); | ||
}, 1000); | ||
}); | ||
}); | ||
|
||
it(`/POST (async event notification with key and headers)`, done => { | ||
request(server) | ||
.post('/notifyWithKeyAndHeaders') | ||
.send() | ||
.end(() => { | ||
setTimeout(() => { | ||
expect(RdKafkaController.IS_NOTIFIED_WITH_KEY_AND_HEADERS).to.be.true; | ||
done(); | ||
}, 1000); | ||
}); | ||
}); | ||
|
||
it(`/POST (async event notification with key and many headers)`, done => { | ||
request(server) | ||
.post('/notifyWithKeyAndManyHeaders') | ||
.send() | ||
.end(() => { | ||
setTimeout(() => { | ||
expect(RdKafkaController.IS_NOTIFIED_WITH_KEY_AND_MANY_HEADERS).to.be.true; | ||
done(); | ||
}, 1000); | ||
}); | ||
}); | ||
|
||
// it(`/POST (sync sum kafka message)`, function () { | ||
// return request(server) | ||
// .post('/mathSumSyncKafkaMessage') | ||
|
@@ -86,18 +134,6 @@ describe('RdKafka transport', function () { | |
// .expect(200, '15'); | ||
// }); | ||
|
||
it(`/POST (async event notification)`, done => { | ||
request(server) | ||
.post('/notify') | ||
.send() | ||
.end(() => { | ||
setTimeout(() => { | ||
expect(RdKafkaController.IS_NOTIFIED).to.be.true; | ||
done(); | ||
}, 1000); | ||
}); | ||
}); | ||
|
||
// const userDto: UserDto = { | ||
// email: '[email protected]', | ||
// name: 'Ben', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.