From 87dfd0dab1a8ee703a41728c0351e0a8beb8defd Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 7 Apr 2025 12:47:31 -0700 Subject: [PATCH] rename build method to buildForTesting --- src/entities/InterchangeSystem.ts | 6 +++--- test/testHelpers/apolloTestServerHelpers.ts | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/entities/InterchangeSystem.ts b/src/entities/InterchangeSystem.ts index 5a2dc9f..106ea01 100644 --- a/src/entities/InterchangeSystem.ts +++ b/src/entities/InterchangeSystem.ts @@ -5,6 +5,7 @@ import { UnoptimizedInMemoryShuttleRepository } from "../repositories/Unoptimize import { RedisNotificationRepository } from "../repositories/RedisNotificationRepository"; import { NotificationRepository } from "../repositories/NotificationRepository"; import { ShuttleGetterSetterRepository } from "../repositories/ShuttleGetterSetterRepository"; +import { InMemoryNotificationRepository } from "../repositories/InMemoryNotificationRepository"; export interface InterchangeSystemBuilderArguments { name: string; @@ -35,15 +36,14 @@ export class InterchangeSystem { * Construct an instance of the class where all composited * classes are correctly linked. * @param args - * @param notificationRepository */ - static build( + static buildForTesting( args: InterchangeSystemBuilderArguments, - notificationRepository: NotificationRepository = new RedisNotificationRepository() ) { const shuttleRepository = new UnoptimizedInMemoryShuttleRepository(); const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(args.passioSystemId, shuttleRepository); + const notificationRepository = new InMemoryNotificationRepository(); const notificationScheduler = new ETANotificationScheduler(shuttleRepository, notificationRepository); return new InterchangeSystem( diff --git a/test/testHelpers/apolloTestServerHelpers.ts b/test/testHelpers/apolloTestServerHelpers.ts index 6db5542..731ae98 100644 --- a/test/testHelpers/apolloTestServerHelpers.ts +++ b/test/testHelpers/apolloTestServerHelpers.ts @@ -24,9 +24,8 @@ const systemInfoForTesting = { }; export function buildSystemForTesting() { - return InterchangeSystem.build( + return InterchangeSystem.buildForTesting( systemInfoForTesting, - new InMemoryNotificationRepository() ); }