use super::debug_contracts::LoggingSchemaDebugSummary;
use super::debug_evaluation::ExpectedTablesEvaluation;
use super::debug_observed_table_contracts::ObservedTablesMap;
use super::debug_report_output_input_contracts::LoggingSchemaDebugReportOutputInput;
use super::debug_still_needed::LoggingSchemaDebugStillNeeded;
pub(super) fn build_debug_report_output_input_assembly(
logging_client: String,
summary: LoggingSchemaDebugSummary,
evaluation: ExpectedTablesEvaluation,
still_needed: LoggingSchemaDebugStillNeeded,
observed_map: ObservedTablesMap,
) -> LoggingSchemaDebugReportOutputInput {
LoggingSchemaDebugReportOutputInput {
logging_client,
summary,
evaluation,
still_needed,
observed_map,
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::api::schema::debug_report_output_projection_test_fixtures::{
build_report_output_projection_expected_table_evaluation_for_tests,
build_report_output_projection_observed_map_with_gateway_request_for_tests,
build_report_output_projection_still_needed_empty_for_tests,
build_report_output_projection_summary_healthy_for_tests,
};
#[test]
fn report_output_input_assembly_preserves_fields() {
let logging_client = "athena_logging".to_string();
let summary = build_report_output_projection_summary_healthy_for_tests(1);
let evaluation = build_report_output_projection_expected_table_evaluation_for_tests();
let still_needed = build_report_output_projection_still_needed_empty_for_tests();
let observed_map =
build_report_output_projection_observed_map_with_gateway_request_for_tests();
let input = build_debug_report_output_input_assembly(
logging_client,
summary,
evaluation,
still_needed,
observed_map,
);
assert_eq!(input.logging_client, "athena_logging");
assert_eq!(input.summary.health, "healthy");
assert_eq!(input.evaluation.expected_tables.len(), 1);
assert!(input.still_needed.required_missing_tables.is_empty());
assert_eq!(input.observed_map.len(), 1);
}
}