Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void close() {
export function EnvJson({ asyncapi, params }) {
const server = asyncapi.allServers().get(params.server);
const url = server.url();
const hostname = server.host() || server.url();
const protocol = server.protocol();
let user = params.user;
let password = params.password;
Expand Down Expand Up @@ -153,7 +154,7 @@ export function EnvJson({ asyncapi, params }) {
return `
{
"KAFKA_ENDPOINTS": [{
"BOOTSTRAP_ADDRESS": "${url}",
"BOOTSTRAP_ADDRESS": "${hostname}",
"APP_USER": "${user}",
"APP_PASSWORD": "${password}"
}]
Expand Down
5 changes: 5 additions & 0 deletions test/Kafka.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ describe('kafka integration tests using the generator', () => {
for (const expectedLine of expectedConnectionHelperLines) {
expect(connectionHelper.includes(expectedLine)).toBe(true);
}
const connectionEnv = readFileSync(path.join(OUTPUT_DIR, 'env.json'), 'utf-8');
const foundStreetlightsScram = connectionEnv.includes('"BOOTSTRAP_ADDRESS": "test.mykafkacluster.org:18092"');
const foundStreetlightsMtls = connectionEnv.includes('"BOOTSTRAP_ADDRESS": "test.mykafkacluster.org:28092"');
const foundRecordLabelKafka = connectionEnv.includes('"BOOTSTRAP_ADDRESS": "my-kafka-hostname:9092"');
expect(foundStreetlightsScram || foundStreetlightsMtls || foundRecordLabelKafka).toBe(true);

return true;
};
Expand Down