@@ -88,9 +88,9 @@ groups() ->
8888 {with_introspection_endpoint , [], [
8989 test_successful_connection_with_valid_opaque_token ,
9090 test_unsuccessful_connection_with_invalid_opaque_token ,
91- test_successful_opaque_token_refresh
92- % test_successful_opaque_token_refresh_with_more_restrictive_token,
93- % test_unsuccessful_opaque_token_refresh_with_inactive_token
91+ test_successful_opaque_token_refresh ,
92+ test_successful_opaque_token_refresh_with_more_restrictive_token ,
93+ test_unsuccessful_opaque_token_refresh_with_inactive_token
9494 ]}
9595 ].
9696
@@ -573,11 +573,12 @@ test_unsuccessful_opaque_token_refresh_with_inactive_token(Config) ->
573573 # 'queue.declare_ok' {queue = _ } =
574574 amqp_channel :call (Ch , # 'queue.declare' {exclusive = true }),
575575
576- Result = amqp_connection :update_secret (Conn , <<" inactive" >>, <<" token refresh" >>),
577- ct : log ( " Result: ~p " , [ Result ]),
578-
579- ? assertException ( exit , {{ nodedown , not_allowed }, _ }, Result ).
576+ amqp_connection :update_secret (Conn , <<" inactive" >>, <<" token refresh" >>),
577+
578+ ? assertExit ({{ shutdown , { connection_closing , { server_initiated_close , 530 , _ }}}, _ },
579+ amqp_connection : open_channel ( Conn )),
580580
581+ catch close_connection (Conn ).
581582
582583
583584mqtt (Config ) ->
@@ -1087,12 +1088,17 @@ test_failed_token_refresh_case1(Config) ->
10871088 catch close_connection (Conn ).
10881089
10891090refreshed_token_cannot_change_username (Config ) ->
1090- {_ , Token } = generate_valid_token_with_sub (Config , <<" username " >>),
1091- Conn = open_unmanaged_connection (Config , 0 , <<" vhost4 " >>, <<" username " >>, Token ),
1091+ {_ , Token } = generate_valid_token_with_sub (Config , <<" username3 " >>),
1092+ Conn = open_unmanaged_connection (Config , 0 , <<" vhost1 " >>, <<" username3 " >>, Token ),
10921093 {_ , RefreshedToken } = generate_valid_token_with_sub (Config , <<" username2" >>),
10931094
10941095 % % the error is communicated asynchronously via a connection-level error
1095- ? assertException (exit , {{nodedown ,not_allowed },_ }, amqp_connection :update_secret (Conn , RefreshedToken , <<" token refresh" >>)).
1096+ amqp_connection :update_secret (Conn , RefreshedToken , <<" should fail token refresh" >>),
1097+
1098+ ? assertExit ({{shutdown , {connection_closing , {server_initiated_close , 530 , _ }}}, _ },
1099+ amqp_connection :open_channel (Conn )),
1100+
1101+ catch close_connection (Conn ).
10961102
10971103
10981104test_failed_token_refresh_case2 (Config ) ->
0 commit comments