use super::debug_contracts::LoggingSchemaDebugReport;
use super::debug_report::build_logging_schema_debug_report_from_input;
use super::debug_service_loader_output_input_contracts::LoggingSchemaDebugReportForClientOutputInput;
use super::debug_service_loader_output_report_input_assembly::build_debug_service_loader_output_report_input_assembly;
pub(super) fn build_logging_schema_debug_report_for_client_output(
input: LoggingSchemaDebugReportForClientOutputInput,
) -> LoggingSchemaDebugReport {
let LoggingSchemaDebugReportForClientOutputInput {
logging_client_name,
snapshot,
} = input;
let report_builder_input =
build_debug_service_loader_output_report_input_assembly(logging_client_name, snapshot);
build_logging_schema_debug_report_from_input(report_builder_input)
}
#[cfg(test)]
mod tests {
use super::*;
use crate::api::schema::debug_snapshot_contracts::LoggingSchemaSnapshot;
#[test]
fn output_assembly_preserves_logging_client_name() {
let report = build_logging_schema_debug_report_for_client_output(
LoggingSchemaDebugReportForClientOutputInput {
logging_client_name: "athena_logging".to_string(),
snapshot: LoggingSchemaSnapshot {
relations: vec![],
columns: vec![],
},
},
);
assert_eq!(report.logging_client, "athena_logging");
assert!(report.observed_tables.is_empty());
}
}