File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ public void close() {
109109export function EnvJson ( { asyncapi, params } ) {
110110 const server = asyncapi . allServers ( ) . get ( params . server ) ;
111111 const url = server . url ( ) ;
112+ const hostname = server . host ( ) || server . url ( ) ;
112113 const protocol = server . protocol ( ) ;
113114 let user = params . user ;
114115 let password = params . password ;
@@ -153,7 +154,7 @@ export function EnvJson({ asyncapi, params }) {
153154 return `
154155 {
155156 "KAFKA_ENDPOINTS": [{
156- "BOOTSTRAP_ADDRESS": "${ url } ",
157+ "BOOTSTRAP_ADDRESS": "${ hostname } ",
157158 "APP_USER": "${ user } ",
158159 "APP_PASSWORD": "${ password } "
159160 }]
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ describe('kafka integration tests using the generator', () => {
4343 for ( const expectedLine of expectedConnectionHelperLines ) {
4444 expect ( connectionHelper . includes ( expectedLine ) ) . toBe ( true ) ;
4545 }
46+ const connectionEnv = readFileSync ( path . join ( OUTPUT_DIR , 'env.json' ) , 'utf-8' ) ;
47+ const foundStreetlightsScram = connectionEnv . includes ( '"BOOTSTRAP_ADDRESS": "test.mykafkacluster.org:18092"' ) ;
48+ const foundStreetlightsMtls = connectionEnv . includes ( '"BOOTSTRAP_ADDRESS": "test.mykafkacluster.org:28092"' ) ;
49+ const foundRecordLabelKafka = connectionEnv . includes ( '"BOOTSTRAP_ADDRESS": "my-kafka-hostname:9092"' ) ;
50+ expect ( foundStreetlightsScram || foundStreetlightsMtls || foundRecordLabelKafka ) . toBe ( true ) ;
4651
4752 return true ;
4853 } ;
You can’t perform that action at this time.
0 commit comments