()
| 54 | |
| 55 | #[tokio::test] |
| 56 | async fn test_transaction_rollback() { |
| 57 | run_test(async { |
| 58 | let pool = connection_pool().await; |
| 59 | let executor = Arc::new(RwLock::new(Executor::new(pool))); |
| 60 | |
| 61 | executor.write().await.begin().await.unwrap(); |
| 62 | // let trx: Transactions = connection.begin().await.unwrap(); |
| 63 | let mut board_repo: Repository<BoardAggregate> = |
| 64 | board_repository_helper(executor.clone()); |
| 65 | |
| 66 | let mut board_aggregate = board_create_helper(BoardState::Unpublished); |
| 67 | let id = board_repo.add(&mut board_aggregate).await.unwrap(); |
| 68 | |
| 69 | executor.write().await.rollback().await.unwrap(); |
| 70 | |
| 71 | //TODO Shouldn't exist |
| 72 | if board_repo.get(&id).await.is_ok() { |
| 73 | panic!("Shouldn't exist!") |
| 74 | } |
| 75 | }) |
| 76 | .await; |
| 77 | } |
| 78 | } |
nothing calls this directly
no test coverage detected