-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add aws self-managed kafka event source (#686)
- Loading branch information
Showing
7 changed files
with
86 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const eventSources = require('../src/event-sources') | ||
const testUtils = require('./utils') | ||
|
||
const selfManagedKafkaEventSource = eventSources.getEventSource({ | ||
eventSourceName: 'AWS_SELF_MANAGED_KAFKA' | ||
}) | ||
|
||
test('request is correct', () => { | ||
const req = getReq() | ||
expect(typeof req).toEqual('object') | ||
expect(req.headers).toEqual({ host: 'self-managed-kafka' }) | ||
expect(req.body).toEqual(testUtils.selfManagedKafkaEvent) | ||
expect(req.method).toEqual('POST') | ||
}) | ||
|
||
function getReq () { | ||
const event = testUtils.selfManagedKafkaEvent | ||
const request = selfManagedKafkaEventSource.getRequest({ event }) | ||
return request | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { emptyResponseMapper } = require('../utils') | ||
|
||
const getRequestValuesFromSelfManagedKafka = ({ event }) => { | ||
const method = 'POST' | ||
const headers = { host: 'self-managed-kafka' } | ||
const body = event | ||
|
||
return { | ||
method, | ||
headers, | ||
body | ||
} | ||
} | ||
module.exports = { | ||
getRequest: getRequestValuesFromSelfManagedKafka, | ||
getResponse: emptyResponseMapper | ||
} |
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