Skip to content

Commit 0ea7cf9

Browse files
Correct GET /api/overview deserialization
1 parent 21f4767 commit 0ea7cf9

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

src/responses.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,6 @@ impl fmt::Display for ChurnRates {
981981
}
982982

983983
#[derive(Debug, Deserialize, Clone, PartialEq, PartialOrd)]
984-
#[serde(transparent)]
985984
#[cfg_attr(feature = "tabled", derive(Tabled))]
986985
pub struct Rate {
987986
pub rate: f64,
@@ -1005,8 +1004,7 @@ pub struct QueueTotals {
10051004
pub messages_ready_for_delivery: u64,
10061005
#[serde(rename = "messages_unacknowledged")]
10071006
pub messages_delivered_but_unacknowledged_by_consumers: u64,
1008-
1009-
pub message_details: Rate,
1007+
pub messages_details: Rate,
10101008
#[serde(rename = "messages_ready_details")]
10111009
pub messages_ready_for_delivery_details: Rate,
10121010
#[serde(rename = "messages_unacknowledged_details")]

tests/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::blocking_api::Client;
15+
16+
mod test_helpers;
17+
use crate::test_helpers::{endpoint, PASSWORD, USERNAME};
18+
19+
#[test]
20+
fn test_overview() {
21+
let endpoint = endpoint();
22+
let rc = Client::new(&endpoint, USERNAME, PASSWORD);
23+
24+
let result1 = rc.overview();
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)