-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Add update-secret to the connection (#155)
One more function had to be added to the ConnectionCallback
- Loading branch information
Showing
7 changed files
with
97 additions
and
1 deletion.
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
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
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,34 @@ | ||
use amqprs::{ | ||
callbacks::{DefaultChannelCallback, DefaultConnectionCallback}, | ||
connection::Connection, | ||
}; | ||
mod common; | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_update_secret() { | ||
common::setup_logging(); | ||
|
||
// open a connection to RabbitMQ server | ||
let args = common::build_conn_args(); | ||
|
||
let connection = Connection::open(&args).await.unwrap(); | ||
connection | ||
.register_callback(DefaultConnectionCallback) | ||
.await | ||
.unwrap(); | ||
// open a channel on the connection | ||
let channel = connection.open_channel(None).await.unwrap(); | ||
channel | ||
.register_callback(DefaultChannelCallback) | ||
.await | ||
.unwrap(); | ||
|
||
connection | ||
.update_secret("123456", "secret expired") | ||
.await | ||
.unwrap(); | ||
|
||
// close | ||
channel.close().await.unwrap(); | ||
connection.close().await.unwrap(); | ||
} |
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