Skip to content

Commit 1775510

Browse files
Async client: add a missing slash to API endpoint path
1 parent 6f8e8fc commit 1775510

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ reqwest = { version = "0.12.12", features = [
2828
], optional = true }
2929
backtrace = { version = "0.3", optional = true }
3030
thiserror = { version = "2", optional = true }
31+
tokio = "1.43.0"
3132

3233

3334
[dev-dependencies]
3435
amqprs = { version = "2"}
35-
cargo-nextest = "0.9.87"
36+
cargo-nextest = "0.9.88"
3637
regex = { version = "1", features = ["std"] }
3738

3839
[features]

src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ where
16221622
where
16231623
S: AsRef<str>,
16241624
{
1625-
format!("{}{}", self.endpoint, path.as_ref())
1625+
format!("{}/{}", self.endpoint, path.as_ref())
16261626
}
16271627
}
16281628

tests/async_overview_tests.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (C) 2023-2025 RabbitMQ Core Team ([email protected])
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
use rabbitmq_http_client::api::Client;
15+
16+
mod test_helpers;
17+
use crate::test_helpers::{endpoint, PASSWORD, USERNAME};
18+
19+
#[tokio::test]
20+
async fn test_async_overview() {
21+
let endpoint = endpoint();
22+
let rc = Client::new(&endpoint, USERNAME, PASSWORD);
23+
24+
let result1 = rc.overview().await;
25+
assert!(result1.is_ok(), "overview returned {:?}", result1);
26+
27+
let ov = result1.unwrap();
28+
assert!(ov.object_totals.exchanges > 0);
29+
}

0 commit comments

Comments
 (0)