refactor(import): fix test files to not use AppContext

This commit is contained in:
2026-06-11 21:51:24 +02:00
parent b5ff43d9dc
commit 76edd52bb0
2 changed files with 9 additions and 9 deletions

View File

@@ -22,12 +22,12 @@ use crate::test_helpers::TestContextBuilder;
#[tokio::test]
async fn applies_mapping_to_session() {
let sessions = InMemoryImportSessionRepository::new();
let ctx = TestContextBuilder::new().build();
let b = TestContextBuilder::new();
let user_id = Uuid::new_v4();
let session = create_session::execute(
Arc::clone(&sessions) as _,
ctx.services.document_parser.clone(),
b.document_parser.clone(),
CreateImportSessionCommand {
user_id,
bytes: b"title\nTest".to_vec(),
@@ -39,8 +39,8 @@ async fn applies_mapping_to_session() {
let rows = apply_mapping::execute(
Arc::clone(&sessions) as _,
ctx.services.document_parser.clone(),
ctx.repos.movie.clone(),
b.document_parser.clone(),
b.movie_repo.clone(),
ApplyImportMappingCommand {
user_id,
session_id: session.session_id.value(),
@@ -56,12 +56,12 @@ async fn applies_mapping_to_session() {
#[tokio::test]
async fn fails_when_session_not_found() {
let sessions = InMemoryImportSessionRepository::new();
let ctx = TestContextBuilder::new().build();
let b = TestContextBuilder::new();
let result = apply_mapping::execute(
Arc::clone(&sessions) as _,
ctx.services.document_parser.clone(),
ctx.repos.movie.clone(),
b.document_parser.clone(),
b.movie_repo.clone(),
ApplyImportMappingCommand {
user_id: Uuid::new_v4(),
session_id: Uuid::new_v4(),

View File

@@ -10,11 +10,11 @@ use crate::test_helpers::TestContextBuilder;
#[tokio::test]
async fn creates_session_with_parsed_file() {
let sessions = InMemoryImportSessionRepository::new();
let ctx = TestContextBuilder::new().build();
let b = TestContextBuilder::new();
let result = create_session::execute(
Arc::clone(&sessions) as _,
ctx.services.document_parser.clone(),
b.document_parser.clone(),
CreateImportSessionCommand {
user_id: Uuid::new_v4(),
bytes: b"col1\nval1".to_vec(),