rename build method to buildForTesting

This commit is contained in:
2025-04-07 12:47:31 -07:00
parent 0525ccc7e4
commit 87dfd0dab1
2 changed files with 4 additions and 5 deletions

View File

@@ -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(

View File

@@ -24,9 +24,8 @@ const systemInfoForTesting = {
};
export function buildSystemForTesting() {
return InterchangeSystem.build(
return InterchangeSystem.buildForTesting(
systemInfoForTesting,
new InMemoryNotificationRepository()
);
}