From: Jérôme Benoit Date: Sun, 1 Mar 2026 22:24:35 +0000 (+0100) Subject: refactor(test): remove duplicate MockChargingStation interface from MockFactories X-Git-Tag: v3~39 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=33e4c6deb6e2e66f503cd18e01ffd066c736beac;p=e-mobility-charging-stations-simulator.git refactor(test): remove duplicate MockChargingStation interface from MockFactories - Delete unused MockChargingStation interface (duplicate of StationHelpers.ts) - Delete unused createMockAuthChargingStation factory function - Keep createMockAuthServiceTestStation which is actively used (34 calls) --- diff --git a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts index 7c6b9fca..60470de0 100644 --- a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts +++ b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts @@ -268,47 +268,6 @@ export const createTestAuthConfig = ( // ChargingStation Mock // ============================================================================ -/** - * Minimal ChargingStation interface for auth module testing. - * Contains only the properties needed by auth strategies and services. - */ -export interface MockChargingStation { - getConnectorStatus: (connectorId: number) => undefined | { status: string } - idTagLocalAuthorized: (idTag: string) => boolean - isConnected: () => boolean - logPrefix: () => string - ocppVersion: OCPPVersion - sendRequest: (commandName: string, payload: unknown) => Promise - stationInfo: { - chargingStationId: string - hashId: string - } -} - -/** - * Create a mock ChargingStation for auth module unit testing. - * - * Returns MockChargingStation interface - minimal interface for auth strategies. - * For OCPPAuthService tests requiring full ChargingStation type, use createMockAuthServiceTestStation(). - * @param overrides - Partial MockChargingStation properties to override defaults - * @returns Mock ChargingStation object with stubbed methods - */ -export const createMockAuthChargingStation = ( - overrides?: Partial -): MockChargingStation => ({ - getConnectorStatus: () => ({ status: 'Available' }), - idTagLocalAuthorized: () => false, - isConnected: () => true, - logPrefix: () => '[MockStation]', - ocppVersion: OCPPVersion.VERSION_16, - sendRequest: () => Promise.resolve({}), - stationInfo: { - chargingStationId: 'test-station-001', - hashId: 'test-hash-001', - }, - ...overrides, -}) - /** * Create a mock ChargingStation for auth service testing. * Provides minimal station interface needed for OCPPAuthServiceImpl tests.