File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
selenium/test/authnz-msg-protocols Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,7 @@ var untilConnectionEstablished = new Promise((resolve, reject) => {
1010 } )
1111} )
1212
13- onAmqp ( 'message' , function ( context ) {
14- receivedAmqpMessageCount ++
15- } )
13+
1614onceAmqp ( 'sendable' , function ( context ) {
1715 context . sender . send ( { body :'first message' } )
1816} )
@@ -52,16 +50,21 @@ describe('Having AMQP 1.0 protocol enabled and the following auth_backends: ' +
5250 } )
5351
5452 it ( 'can open an AMQP 1.0 connection' , async function ( ) {
53+ var untilFirstMessageReceived = new Promise ( ( resolve , reject ) => {
54+ onAmqp ( 'message' , function ( context ) {
55+ resolve ( )
56+ } )
57+ } )
5558 amqp = openAmqp ( )
5659 await untilConnectionEstablished
57- var untilMessageReceived = new Promise ( ( resolve , reject ) => {
60+ await untilFirstMessageReceived
61+ var untilSecondMessageReceived = new Promise ( ( resolve , reject ) => {
5862 onAmqp ( 'message' , function ( context ) {
5963 resolve ( )
6064 } )
6165 } )
6266 amqp . sender . send ( { body :'second message' } )
63- await untilMessageReceived
64- assert . equal ( 2 , receivedAmqpMessageCount )
67+ await untilSecondMessageReceived
6568 } )
6669
6770 after ( function ( ) {
You can’t perform that action at this time.
0 commit comments