boxmux 0.240.3373

YAML-driven terminal UI framework for rich, interactive CLI applications and dashboards with PTY support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
//! Test utilities and data factories for BoxMux
//!
//! This module provides common test utilities, data factories, and helper functions
//! to make writing tests easier and more consistent across the codebase.

use crate::model::app::{App, AppContext};
use crate::model::common::{Anchor, BatchStatus, Bounds, InputBounds, SocketFunction};
use crate::model::layout::Layout;
use crate::model::muxbox::MuxBox;
use crate::thread_manager::Message;
use crate::Config;
use std::collections::HashMap;
use uuid::Uuid;

/// Test data factory for creating consistent test objects
pub struct TestDataFactory;

impl TestDataFactory {
    /// Create a minimal test muxbox with required fields
    pub fn create_test_muxbox(id: &str) -> MuxBox {
        MuxBox {
            id: id.to_string(),
            title: Some("Test MuxBox".to_string()),
            position: InputBounds {
                x1: "0".to_string(),
                y1: "0".to_string(),
                x2: "100".to_string(),
                y2: "50".to_string(),
            },
            anchor: Anchor::default(),
            min_width: None,
            min_height: None,
            max_width: None,
            max_height: None,
            overflow_behavior: None,
            refresh_interval: None,
            tab_order: None,
            next_focus_id: None,
            children: None,
            fill: None,
            fill_char: None,
            selected_fill_char: None,
            border_color: None,
            selected_border_color: None,
            bg_color: None,
            selected_bg_color: None,
            fg_color: None,
            selected_fg_color: None,
            title_fg_color: None,
            title_bg_color: None,
            selected_title_bg_color: None,
            selected_title_fg_color: None,
            title_position: None,
            error_border_color: None,
            error_bg_color: None,
            error_fg_color: None,
            error_title_bg_color: None,
            error_title_fg_color: None,
            error_selected_border_color: None,
            error_selected_bg_color: None,
            error_selected_fg_color: None,
            error_selected_title_bg_color: None,
            error_selected_title_fg_color: None,
            highlighted_fill_char: None,
            highlighted_border_color: None,
            highlighted_bg_color: None,
            highlighted_fg_color: None,
            highlighted_title_bg_color: None,
            highlighted_title_fg_color: None,
            highlighted_menu_fg_color: None,
            highlighted_menu_bg_color: None,
            choices: None,
            menu_fg_color: None,
            menu_bg_color: None,
            selected_menu_fg_color: None,
            selected_menu_bg_color: None,
            redirect_output: None,
            append_output: None,
            script: None,
            on_keypress: None,
            variables: None,
            horizontal_scroll: None,
            vertical_scroll: None,
            selected: None,
            content: Some("Test content".to_string()),
            save_in_file: None,
            chart_type: None,
            chart_data: None,
            plugin_component: None,
            plugin_config: None,
            table_data: None,
            table_config: None,
            auto_scroll_bottom: None,
            execution_mode: crate::model::common::ExecutionMode::default(),
            z_index: None,
            output: String::new(),
            parent_id: None,
            parent_layout_id: None,
            error_state: false,
            scroll_x: 0,
            scroll_y: 0,
            tab_scroll_offset: 0,
            hovered_tab_target: None,
            streams: indexmap::IndexMap::new(),
            selected_stream_id: None,
        }
    }

    /// Create a muxbox with custom properties
    pub fn create_custom_muxbox(id: &str, content: &str) -> MuxBox {
        let mut muxbox = Self::create_test_muxbox(id);
        muxbox.content = Some(content.to_string());
        muxbox.title = Some(format!("{} MuxBox", id));
        muxbox
    }

    /// Create a test muxbox with parent layout ID set
    pub fn create_test_muxbox_with_parent(id: &str, parent_layout_id: &str) -> MuxBox {
        let mut muxbox = Self::create_test_muxbox(id);
        muxbox.parent_layout_id = Some(parent_layout_id.to_string());
        muxbox
    }

    /// Create a test layout with muxboxes
    pub fn create_test_layout(id: &str, muxboxes: Option<Vec<MuxBox>>) -> Layout {
        let mut boxes =
            muxboxes.unwrap_or_else(|| vec![Self::create_test_muxbox("default_muxbox")]);

        // Set parent layout ID for all boxes
        for muxbox in &mut boxes {
            muxbox.parent_layout_id = Some(id.to_string());
        }

        Layout {
            id: id.to_string(),
            title: Some(format!("Test Layout {}", id)),
            refresh_interval: None,
            children: Some(boxes),
            fill: None,
            fill_char: None,
            selected_fill_char: None,
            border_color: None,
            selected_border_color: None,
            bg_color: None,
            selected_bg_color: None,
            fg_color: None,
            selected_fg_color: None,
            title_fg_color: None,
            title_bg_color: None,
            title_position: None,
            selected_title_bg_color: None,
            selected_title_fg_color: None,
            menu_fg_color: None,
            menu_bg_color: None,
            selected_menu_fg_color: None,
            selected_menu_bg_color: None,
            error_border_color: None,
            error_bg_color: None,
            error_fg_color: None,
            error_title_bg_color: None,
            error_title_fg_color: None,
            error_selected_border_color: None,
            error_selected_bg_color: None,
            error_selected_fg_color: None,
            error_selected_title_bg_color: None,
            error_selected_title_fg_color: None,
            highlighted_fill_char: None,
            highlighted_border_color: None,
            highlighted_bg_color: None,
            highlighted_fg_color: None,
            highlighted_title_bg_color: None,
            highlighted_title_fg_color: None,
            highlighted_menu_fg_color: None,
            highlighted_menu_bg_color: None,
            overflow_behavior: None,
            root: Some(false),
            on_keypress: None,
            active: None,
            muxbox_ids_in_tab_order: None,
        }
    }

    /// Create a test layout marked as root
    pub fn create_root_layout(id: &str, boxes: Option<Vec<MuxBox>>) -> Layout {
        let mut layout = Self::create_test_layout(id, boxes);
        layout.root = Some(true);
        layout
    }

    /// Create a test app with basic structure
    pub fn create_test_app() -> App {
        let layout = Self::create_root_layout("test_layout", None); // Use None to let create_test_layout handle muxbox creation

        let mut app = App::new();
        app.layouts = vec![layout];
        app.libs = None;
        app.on_keypress = None;
        app.hot_keys = None;
        app
    }

    /// Create an app with multiple layouts for testing layout switching
    pub fn create_multi_layout_app() -> App {
        let layout1 = Self::create_root_layout(
            "layout1",
            Some(vec![Self::create_test_muxbox_with_parent(
                "muxbox1", "layout1",
            )]),
        );
        let layout2 = Self::create_test_layout(
            "layout2",
            Some(vec![Self::create_test_muxbox_with_parent(
                "muxbox2", "layout2",
            )]),
        );
        let layout3 = Self::create_test_layout(
            "layout3",
            Some(vec![Self::create_test_muxbox_with_parent(
                "muxbox3", "layout3",
            )]),
        );

        let mut app = App::new();
        app.layouts = vec![layout1, layout2, layout3];
        app.libs = None;
        app.on_keypress = None;
        app
    }

    /// Create test bounds with specified dimensions
    pub fn create_bounds(x1: usize, y1: usize, x2: usize, y2: usize) -> Bounds {
        Bounds { x1, y1, x2, y2 }
    }

    /// Create test input bounds with string coordinates
    pub fn create_input_bounds(x1: &str, y1: &str, x2: &str, y2: &str) -> InputBounds {
        InputBounds {
            x1: x1.to_string(),
            y1: y1.to_string(),
            x2: x2.to_string(),
            y2: y2.to_string(),
        }
    }

    /// Create app context for testing
    pub fn create_test_app_context() -> AppContext {
        AppContext {
            app: Self::create_test_app(),
            config: Config::default(),
            plugin_registry: std::sync::Arc::new(std::sync::Mutex::new(
                crate::plugin::PluginRegistry::new(),
            )),
            pty_manager: None,
            yaml_file_path: None,
            live_yaml_sync: None,
        }
    }

    /// Create socket function for testing
    pub fn create_socket_function_replace_content(
        box_id: &str,
        content: &str,
        success: bool,
    ) -> SocketFunction {
        SocketFunction::ReplaceBoxContent {
            box_id: box_id.to_string(),
            success,
            content: content.to_string(),
        }
    }

    /// Create socket function for testing script replacement
    pub fn create_socket_function_replace_script(
        box_id: &str,
        script: Vec<String>,
    ) -> SocketFunction {
        SocketFunction::ReplaceBoxScript {
            box_id: box_id.to_string(),
            script,
        }
    }
}

/// Test assertion helpers
pub struct TestAssertions;

impl TestAssertions {
    /// Assert that a box exists in a layout with specific properties
    pub fn assert_box_exists_in_layout(layout: &Layout, box_id: &str) -> bool {
        layout
            .children
            .as_ref()
            .map_or(false, |boxes| boxes.iter().any(|p| p.id == box_id))
    }

    /// Assert that a box has specific content
    pub fn assert_box_has_content(muxbox: &MuxBox, expected_content: &str) -> bool {
        muxbox.content.as_ref().map(|c| c.as_str()) == Some(expected_content)
    }

    /// Assert that an app has a specific active layout
    pub fn assert_app_active_layout(app: &App, expected_layout_id: &str) -> bool {
        // App doesn't have active_layout field - use get_active_layout() method
        app.get_active_layout().map(|layout| layout.id.as_str()) == Some(expected_layout_id)
    }

    /// Assert that a layout is marked as root
    pub fn assert_layout_is_root(layout: &Layout) -> bool {
        layout.root.unwrap_or(false)
    }

    /// Assert message type matches expected
    pub fn assert_message_type(message: &Message, expected_type: &str) -> bool {
        match (message, expected_type) {
            (Message::StreamUpdateMessage(_), "StreamUpdate") => true,
            (Message::MuxBoxScriptUpdate(_, _), "MuxBoxScriptUpdate") => true,
            (Message::StopBoxRefresh(_), "StopBoxRefresh") => true,
            (Message::StartBoxRefresh(_), "StartBoxRefresh") => true,
            (Message::SwitchActiveLayout(_), "SwitchActiveLayout") => true,
            (Message::ReplaceMuxBox(_, _), "ReplaceMuxBox") => true,
            (Message::AddBox(_, _), "AddBox") => true,
            (Message::RemoveBox(_), "RemoveBox") => true,
            _ => false,
        }
    }
}

/// Performance testing utilities
pub struct PerformanceTestUtils;

impl PerformanceTestUtils {
    /// Benchmark a function and return the duration
    pub fn benchmark_function<F, R>(iterations: usize, mut func: F) -> std::time::Duration
    where
        F: FnMut() -> R,
    {
        let start = std::time::Instant::now();
        for _ in 0..iterations {
            let _ = func();
        }
        start.elapsed()
    }

    /// Assert that a function meets performance requirements
    pub fn assert_performance<F, R>(
        func: F,
        iterations: usize,
        max_duration: std::time::Duration,
        operation_name: &str,
    ) where
        F: FnMut() -> R,
    {
        let duration = Self::benchmark_function(iterations, func);
        println!(
            "{}: {} iterations took {:?}",
            operation_name, iterations, duration
        );
        assert!(
            duration <= max_duration,
            "{} performance regression: {:?} > {:?}",
            operation_name,
            duration,
            max_duration
        );
    }

    /// Create large test data for performance testing
    pub fn create_large_muxbox_list(count: usize) -> Vec<MuxBox> {
        (0..count)
            .map(|i| TestDataFactory::create_test_muxbox(&format!("muxbox_{}", i)))
            .collect()
    }

    /// Create large test layout with many muxboxes
    pub fn create_large_layout(muxbox_count: usize) -> Layout {
        let muxboxes = Self::create_large_muxbox_list(muxbox_count);
        TestDataFactory::create_test_layout("large_layout", Some(muxboxes))
    }
}

/// Mock and stub utilities for testing
pub struct MockUtils;

impl MockUtils {
    /// Create a mock UUID for consistent testing
    pub fn create_test_uuid() -> Uuid {
        Uuid::parse_str("12345678-1234-5678-9012-123456789012").unwrap()
    }

    /// Create a series of test UUIDs for multiple object testing
    pub fn create_test_uuids(count: usize) -> Vec<Uuid> {
        (0..count)
            .map(|i| {
                Uuid::parse_str(&format!("12345678-1234-5678-9012-12345678901{:01}", i % 10))
                    .unwrap()
            })
            .collect()
    }

    /// Create test script commands
    pub fn create_test_script_commands() -> Vec<String> {
        vec![
            "echo 'test output'".to_string(),
            "date".to_string(),
            "whoami".to_string(),
        ]
    }

    /// Create test key mappings
    pub fn create_test_key_mappings() -> HashMap<String, Vec<String>> {
        let mut mappings = HashMap::new();
        mappings.insert("Ctrl + C".to_string(), vec!["exit".to_string()]);
        mappings.insert("Ctrl + D".to_string(), vec!["quit".to_string()]);
        mappings.insert("Enter".to_string(), vec!["confirm".to_string()]);
        mappings.insert("Escape".to_string(), vec!["cancel".to_string()]);
        mappings.insert("Tab".to_string(), vec!["next_muxbox".to_string()]);
        mappings
    }
}

/// Integration test utilities
pub struct IntegrationTestUtils;

impl IntegrationTestUtils {
    /// Setup complete test environment
    pub fn setup_test_environment() -> (AppContext, std::sync::mpsc::Receiver<(Uuid, Message)>) {
        let app_context = TestDataFactory::create_test_app_context();
        let (tx, rx) = std::sync::mpsc::channel();
        // Additional setup could go here
        (app_context, rx)
    }

    /// Simulate complete workflow from socket command to app update
    pub fn simulate_socket_to_app_workflow(
        socket_function: SocketFunction,
    ) -> Result<Message, Box<dyn std::error::Error>> {
        let (tx, rx) = std::sync::mpsc::channel();
        let test_uuid = MockUtils::create_test_uuid();

        // This would normally go through the socket handler
        let boxmux_message = match socket_function {
            SocketFunction::ReplaceBoxContent {
                box_id,
                success,
                content,
            } => {
                use crate::model::common::{
                    BatchSourceState, ExecutionMode, SourceState, StreamUpdate,
                };
                let stream_update = StreamUpdate {
                    stream_id: format!("{}_default", box_id),
                    target_box_id: box_id.clone(),
                    content_update: content,
                    source_state: SourceState::Batch(BatchSourceState {
                        task_id: "test_task".to_string(),
                        queue_wait_time: std::time::Duration::from_millis(0),
                        execution_time: std::time::Duration::from_millis(100),
                        exit_code: if success { Some(0) } else { Some(1) },
                        status: if success {
                            BatchStatus::Completed
                        } else {
                            BatchStatus::Failed("Test error".to_string())
                        },
                    }),
                    execution_mode: ExecutionMode::Thread,
                };
                Message::StreamUpdateMessage(stream_update)
            }
            SocketFunction::ReplaceBoxScript { box_id, script } => {
                Message::MuxBoxScriptUpdate(box_id, script)
            }
            SocketFunction::StopBoxRefresh { box_id } => Message::StopBoxRefresh(box_id),
            SocketFunction::StartBoxRefresh { box_id } => Message::StartBoxRefresh(box_id),
            SocketFunction::ReplaceBox { box_id, new_box } => {
                Message::ReplaceMuxBox(box_id, new_box)
            }
            SocketFunction::SwitchActiveLayout { layout_id } => {
                Message::SwitchActiveLayout(layout_id)
            }
            SocketFunction::AddBox { layout_id, muxbox } => Message::AddBox(layout_id, muxbox),
            SocketFunction::RemoveBox { box_id } => Message::RemoveBox(box_id),
            // F0137/F0138: Socket PTY Control and Query patterns
            SocketFunction::KillPtyProcess { box_id } => {
                use crate::model::common::{
                    BatchSourceState, ExecutionMode, SourceState, StreamUpdate,
                };
                let stream_update = StreamUpdate {
                    stream_id: format!("{}_pty", box_id),
                    target_box_id: box_id.clone(),
                    content_update: "PTY process killed".to_string(),
                    source_state: SourceState::Batch(BatchSourceState {
                        task_id: "test_task".to_string(),
                        queue_wait_time: std::time::Duration::from_millis(0),
                        execution_time: std::time::Duration::from_millis(100),
                        exit_code: Some(0),
                        status: BatchStatus::Completed,
                    }),
                    execution_mode: ExecutionMode::Pty,
                };
                Message::StreamUpdateMessage(stream_update)
            }
            SocketFunction::RestartPtyProcess { box_id } => {
                use crate::model::common::{
                    BatchSourceState, ExecutionMode, SourceState, StreamUpdate,
                };
                let stream_update = StreamUpdate {
                    stream_id: format!("{}_pty", box_id),
                    target_box_id: box_id.clone(),
                    content_update: "PTY process restarted".to_string(),
                    source_state: SourceState::Batch(BatchSourceState {
                        task_id: "test_task".to_string(),
                        queue_wait_time: std::time::Duration::from_millis(0),
                        execution_time: std::time::Duration::from_millis(100),
                        exit_code: Some(0),
                        status: BatchStatus::Completed,
                    }),
                    execution_mode: ExecutionMode::Pty,
                };
                Message::StreamUpdateMessage(stream_update)
            }
            SocketFunction::QueryPtyStatus { box_id } => {
                use crate::model::common::{
                    BatchSourceState, ExecutionMode, SourceState, StreamUpdate,
                };
                let stream_update = StreamUpdate {
                    stream_id: format!("{}_pty", box_id),
                    target_box_id: box_id.clone(),
                    content_update: "PTY status queried".to_string(),
                    source_state: SourceState::Batch(BatchSourceState {
                        task_id: "test_task".to_string(),
                        queue_wait_time: std::time::Duration::from_millis(0),
                        execution_time: std::time::Duration::from_millis(100),
                        exit_code: Some(0),
                        status: BatchStatus::Completed,
                    }),
                    execution_mode: ExecutionMode::Pty,
                };
                Message::StreamUpdateMessage(stream_update)
            }
            // F0136: Socket PTY Spawn pattern
            SocketFunction::SpawnPtyProcess { box_id, .. } => {
                use crate::model::common::{
                    BatchSourceState, ExecutionMode, SourceState, StreamUpdate,
                };
                let stream_update = StreamUpdate {
                    stream_id: format!("{}_pty", box_id),
                    target_box_id: box_id.clone(),
                    content_update: "PTY process spawned".to_string(),
                    source_state: SourceState::Batch(BatchSourceState {
                        task_id: "test_task".to_string(),
                        queue_wait_time: std::time::Duration::from_millis(0),
                        execution_time: std::time::Duration::from_millis(100),
                        exit_code: Some(0),
                        status: BatchStatus::Completed,
                    }),
                    execution_mode: ExecutionMode::Pty,
                };
                Message::StreamUpdateMessage(stream_update)
            }
            // F0139: Socket PTY Input pattern
            SocketFunction::SendPtyInput { box_id, .. } => {
                use crate::model::common::{
                    BatchSourceState, ExecutionMode, SourceState, StreamUpdate,
                };
                let stream_update = StreamUpdate {
                    stream_id: format!("{}_pty", box_id),
                    target_box_id: box_id.clone(),
                    content_update: "PTY input sent".to_string(),
                    source_state: SourceState::Batch(BatchSourceState {
                        task_id: "test_task".to_string(),
                        queue_wait_time: std::time::Duration::from_millis(0),
                        execution_time: std::time::Duration::from_millis(100),
                        exit_code: Some(0),
                        status: BatchStatus::Completed,
                    }),
                    execution_mode: ExecutionMode::Pty,
                };
                Message::StreamUpdateMessage(stream_update)
            }
        };

        tx.send((test_uuid, boxmux_message))?;
        let (_, message) = rx.recv()?;
        Ok(message)
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_factory_creates_valid_muxbox() {
        let muxbox = TestDataFactory::create_test_muxbox("test");
        assert_eq!(muxbox.id, "test");
        // MuxBox doesn't have muxbox_type field - removed assertion
        assert!(muxbox.content.is_some());
    }

    #[test]
    fn test_factory_creates_valid_layout() {
        let layout = TestDataFactory::create_test_layout("test_layout", None);
        assert_eq!(layout.id, "test_layout");
        assert!(layout.children.is_some());
        let children = layout.children.as_ref().unwrap();
        assert!(!children.is_empty());
        assert_eq!(children[0].id, "default_muxbox");
    }

    #[test]
    fn test_factory_creates_valid_app() {
        let app = TestDataFactory::create_test_app();
        assert!(!app.layouts.is_empty());
        // App doesn't have active_layout field - checking root layout instead
        assert!(app.layouts[0].root.unwrap_or(false));
        assert!(TestAssertions::assert_layout_is_root(&app.layouts[0]));
    }

    #[test]
    fn test_assertions_work_correctly() {
        let muxbox = TestDataFactory::create_test_muxbox("test");
        assert!(TestAssertions::assert_box_has_content(
            &muxbox,
            "Test content"
        ));
        assert!(!TestAssertions::assert_box_has_content(
            &muxbox,
            "Wrong content"
        ));
    }

    #[test]
    fn test_performance_utils() {
        let duration = PerformanceTestUtils::benchmark_function(1000, || {
            let _ = TestDataFactory::create_test_muxbox("perf_test");
        });

        // Should be able to create 1000 muxboxes very quickly
        assert!(duration.as_millis() < 100);
    }

    #[test]
    fn test_mock_utils() {
        let uuid = MockUtils::create_test_uuid();
        assert_eq!(uuid.to_string(), "12345678-1234-5678-9012-123456789012");

        let uuids = MockUtils::create_test_uuids(3);
        assert_eq!(uuids.len(), 3);
        assert_ne!(uuids[0], uuids[1]); // Should have different endings
    }

    #[test]
    fn test_integration_utils() {
        let socket_function = TestDataFactory::create_socket_function_replace_content(
            "test_muxbox",
            "new content",
            true,
        );

        let result = IntegrationTestUtils::simulate_socket_to_app_workflow(socket_function);
        assert!(result.is_ok());

        let message = result.unwrap();
        assert!(TestAssertions::assert_message_type(
            &message,
            "StreamUpdate"
        ));
    }
}