MCPcopy Create free account
hub / github.com/Migorithm/rustiful-backend / outbox_setup

Function outbox_setup

tests/outbox.rs:22–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 };
21
22 async fn outbox_setup() {
23 let cmd = CreateBoard {
24 author: Uuid::new_v4(),
25 title: "Title!".to_string(),
26 content: "Content".to_string(),
27 state: BoardState::Published,
28 };
29
30 // ! The Following receiver must exist
31 let (context_manager, mut _receiver) = ContextManager::new().await;
32
33 match ServiceHandler::create_board(cmd, context_manager.clone()).await {
34 Err(err) => '_fail_case: {
35 panic!("Service Handling Failed! {}", err)
36 }
37 Ok(response) => '_test: {
38 let id: String = response.try_into().unwrap();
39 let mut uow =
40 UnitOfWork::<Repository<BoardAggregate>>::new(context_manager.clone())
41 .await
42 .unwrap();
43 if let Err(err) = uow.repository().get(&id).await {
44 panic!("Fetching newly created object failed! : {}", err);
45 };
46 }
47 }
48 }
49
50 #[tokio::test]
51 async fn test_create_board_leaves_outbox() {

Calls 3

create_boardFunction · 0.85
repositoryMethod · 0.80
getMethod · 0.45

Tested by 3

test_convert_eventFunction · 0.68