diff --git a/src/notifications/schedulers/__tests__/ETANotificationSchedulerTests.test.ts b/src/notifications/schedulers/__tests__/ETANotificationSchedulerTests.test.ts index 7fc621f..17cfeef 100644 --- a/src/notifications/schedulers/__tests__/ETANotificationSchedulerTests.test.ts +++ b/src/notifications/schedulers/__tests__/ETANotificationSchedulerTests.test.ts @@ -80,7 +80,7 @@ describe("ETANotificationScheduler", () => { // Act await notificationRepository.addOrUpdateNotification(notificationData1); await notificationRepository.addOrUpdateNotification(notificationData2); - await shuttleRepository.addOrUpdateEta(eta); + await shuttleRepository.addOrUpdateEtaFromExternalSource(eta); // Assert // Wait for the callback to actually be called @@ -103,7 +103,7 @@ describe("ETANotificationScheduler", () => { // Act await notificationRepository.addOrUpdateNotification(notificationData1); - await shuttleRepository.addOrUpdateEta(eta); + await shuttleRepository.addOrUpdateEtaFromExternalSource(eta); // Assert await waitForMilliseconds(500); @@ -136,7 +136,7 @@ describe("ETANotificationScheduler", () => { // Act await notificationRepository.addOrUpdateNotification(notificationData1); - await shuttleRepository.addOrUpdateEta(eta); + await shuttleRepository.addOrUpdateEtaFromExternalSource(eta); // Assert // The notification should stay scheduled to be retried once diff --git a/src/resolvers/__tests__/ShuttleResolverTests.test.ts b/src/resolvers/__tests__/ShuttleResolverTests.test.ts index 0ab62d0..ab45245 100644 --- a/src/resolvers/__tests__/ShuttleResolverTests.test.ts +++ b/src/resolvers/__tests__/ShuttleResolverTests.test.ts @@ -25,7 +25,7 @@ describe("ShuttleResolvers", () => { const etas = generateMockEtas(); await Promise.all(etas.map(async (eta) => { eta.shuttleId = shuttleId; - await context.systems[0].shuttleRepository.addOrUpdateEta(eta); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(eta); })); return etas; } @@ -146,9 +146,9 @@ describe("ShuttleResolvers", () => { const e1 = { ...generateMockEtas()[0], shuttleId: mockShuttle.id, stopId: "stA", secondsRemaining: 300 }; const e2 = { ...generateMockEtas()[0], shuttleId: mockShuttle.id, stopId: "stB", secondsRemaining: 30 }; const e3 = { ...generateMockEtas()[0], shuttleId: mockShuttle.id, stopId: "stC", secondsRemaining: 120 }; - await context.systems[0].shuttleRepository.addOrUpdateEta(e1); - await context.systems[0].shuttleRepository.addOrUpdateEta(e2); - await context.systems[0].shuttleRepository.addOrUpdateEta(e3); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e1); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e2); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e3); const response = await holder.testServer.executeOperation({ query, diff --git a/src/resolvers/__tests__/StopResolverTests.test.ts b/src/resolvers/__tests__/StopResolverTests.test.ts index 4378df5..d214dfb 100644 --- a/src/resolvers/__tests__/StopResolverTests.test.ts +++ b/src/resolvers/__tests__/StopResolverTests.test.ts @@ -106,7 +106,7 @@ describe("StopResolvers", () => { mockEtas = mockEtas.filter((eta) => eta.stopId === mockEtas[0].stopId); await Promise.all(mockEtas.map(async eta => { eta.stopId = mockStop.id; - await context.systems[0].shuttleRepository.addOrUpdateEta(eta); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(eta); })); const response = await getResponseForQuery(query); @@ -128,9 +128,9 @@ describe("StopResolvers", () => { const e1 = { ...generateMockEtas()[0], stopId: mockStop.id, shuttleId: "shA", secondsRemaining: 240 }; const e2 = { ...generateMockEtas()[0], stopId: mockStop.id, shuttleId: "shB", secondsRemaining: 60 }; const e3 = { ...generateMockEtas()[0], stopId: mockStop.id, shuttleId: "shC", secondsRemaining: 120 }; - await context.systems[0].shuttleRepository.addOrUpdateEta(e1); - await context.systems[0].shuttleRepository.addOrUpdateEta(e2); - await context.systems[0].shuttleRepository.addOrUpdateEta(e3); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e1); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e2); + await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e3); const response = await getResponseForQuery(query);