- **Station factory**: `createMockChargingStation(options?)` returns `{ station, mocks }` with MockWebSocket, parentPortMessages, file system mocks
- **Auth factories**: `createMockAuthRequest()`, `createMockAuthorizationResult()`, `createMockAuthService()` in `tests/charging-station/ocpp/auth/helpers/MockFactories.ts`
- **Transaction setup**: `setupConnectorWithTransaction(station, connectorId, { transactionId, idTag? })`
-- **Re-export hub**: `tests/charging-station/ChargingStationTestUtils.ts` aggregates all test utilities
+- **Direct imports**: Test files import from the defining module, not through re-export hubs. `src/` barrels remain (public API)
- **`__testable__` pattern**: `ocpp/1.6/__testable__/` and `ocpp/2.0/__testable__/` directories expose internal classes (e.g., `OCPP20VariableManagerTestable`, `OCPP20RequestServiceTestable`) for unit testing private internals. Import from `__testable__/index.ts` barrel in tests only
## Python Conventions (tests/ocpp-server/)
Available constants: `tests/charging-station/ChargingStationTestConstants.ts`
+### Direct Imports (No Re-Export Hubs)
+
+Import from the file that **defines** the symbol — never through an intermediate re-export file.
+
+```typescript
+// ✅ Good - Direct to defining module
+import { createMockChargingStation } from './helpers/StationHelpers.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
+import { MockWebSocket } from './mocks/MockWebSocket.js'
+
+// ❌ Bad - Through re-export hub
+import { createMockChargingStation, standardCleanup } from './ChargingStationTestUtils.js'
+```
+
+**Exception**: `src/` barrel imports (e.g., `src/types/index.js`) are the public API of production modules — use them as-is.
+
---
## 7. Assertions
import { BaseError } from '../../src/exception/index.js'
import { type StartTransactionResult } from '../../src/types/index.js'
import { Constants } from '../../src/utils/Constants.js'
-import { flushMicrotasks } from '../helpers/TestLifecycleHelpers.js'
-import { createMockChargingStation, standardCleanup } from './ChargingStationTestUtils.js'
+import { flushMicrotasks, standardCleanup } from '../helpers/TestLifecycleHelpers.js'
+import { createMockChargingStation } from './helpers/StationHelpers.js'
type ConnectorStatus = ReturnType<AutomaticTransactionGenerator['connectorsStatus']['get']>
import { AvailabilityType, RegistrationStatusEnumType } from '../../src/types/index.js'
import { standardCleanup, withMockTimers } from '../helpers/TestLifecycleHelpers.js'
import { TEST_HEARTBEAT_INTERVAL_MS, TEST_ONE_HOUR_MS } from './ChargingStationTestConstants.js'
-import { cleanupChargingStation, createMockChargingStation } from './ChargingStationTestUtils.js'
+import { cleanupChargingStation, createMockChargingStation } from './helpers/StationHelpers.js'
await describe('ChargingStation Configuration Management', async () => {
// ===== B02/B03 BOOT NOTIFICATION BEHAVIOR TESTS =====
import { RegistrationStatusEnumType } from '../../src/types/index.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
import { TEST_ONE_HOUR_MS } from './ChargingStationTestConstants.js'
-import { cleanupChargingStation, createMockChargingStation } from './ChargingStationTestUtils.js'
+import { cleanupChargingStation, createMockChargingStation } from './helpers/StationHelpers.js'
await describe('ChargingStation Connector and EVSE State', async () => {
await describe('Connector Query', async () => {
import type { ChargingStation } from '../../src/charging-station/index.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-import { cleanupChargingStation, createMockChargingStation } from './ChargingStationTestUtils.js'
+import { cleanupChargingStation, createMockChargingStation } from './helpers/StationHelpers.js'
await describe('ChargingStation Lifecycle', async () => {
await describe('Start/Stop Operations', async () => {
import { RegistrationStatusEnumType, RequestCommand } from '../../src/types/index.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
import { TEST_HEARTBEAT_INTERVAL_MS } from './ChargingStationTestConstants.js'
-import { cleanupChargingStation, createMockChargingStation } from './ChargingStationTestUtils.js'
+import { cleanupChargingStation, createMockChargingStation } from './helpers/StationHelpers.js'
await describe('ChargingStation Resilience', async () => {
await describe('Error Recovery and Resilience', async () => {
withMockTimers,
} from '../helpers/TestLifecycleHelpers.js'
import { TEST_HEARTBEAT_INTERVAL_MS, TEST_ID_TAG } from './ChargingStationTestConstants.js'
-import { cleanupChargingStation, createMockChargingStation } from './ChargingStationTestUtils.js'
+import { cleanupChargingStation, createMockChargingStation } from './helpers/StationHelpers.js'
await describe('ChargingStation Transaction Management', async () => {
await describe('Transaction Query', async () => {
TEST_TRANSACTION_ENERGY_WH,
TEST_TRANSACTION_ID,
} from './ChargingStationTestConstants.js'
-import {
- cleanupChargingStation,
- createMockChargingStation,
- MockIdTagsCache,
- MockSharedLRUCache,
- MockWebSocket,
- WebSocketReadyState,
-} from './ChargingStationTestUtils.js'
+import { cleanupChargingStation, createMockChargingStation } from './helpers/StationHelpers.js'
+import { MockIdTagsCache, MockSharedLRUCache } from './mocks/MockCaches.js'
+import { MockWebSocket, WebSocketReadyState } from './mocks/MockWebSocket.js'
await describe('ChargingStation', async () => {
await describe('Test Utilities', async () => {
+++ /dev/null
-/**
- * Utilities for creating MOCK ChargingStation instances in tests
- *
- * This file provides factory functions to instantiate mock ChargingStation
- * objects (lightweight stubs) with properly isolated dependencies for testing.
- *
- * Key patterns:
- * - MockWebSocket: Captures sent messages for assertion
- * - Singleton mocking: Overrides getInstance() for shared caches
- * - Cleanup utilities: Prevents test pollution via timer/listener cleanup
- * @see tests/charging-station/helpers/StationHelpers.ts for mock factory implementation
- * @see tests/charging-station/ChargingStationTestConstants.ts for test constants
- */
-
-// Re-export test lifecycle helpers
-export {
- clearConnectorTransaction,
- setupConnectorWithTransaction,
- standardCleanup,
-} from '../helpers/TestLifecycleHelpers.js'
-
-// Re-export all helper functions and types from StationHelpers
-export {
- type ChargingStationMocks,
- cleanupChargingStation,
- createConnectorStatus,
- type CreateConnectorStatusOptions,
- createMockChargingStation,
- createMockChargingStationTemplate,
- type MockChargingStation,
- type MockChargingStationOptions,
- type MockChargingStationResult,
- type MockOCPPIncomingRequestService,
- type MockOCPPRequestService,
- resetChargingStationState,
-} from './helpers/StationHelpers.js'
-
-export { MockIdTagsCache, MockSharedLRUCache } from './mocks/MockCaches.js'
-// Re-export all mock classes
-export { MockWebSocket, WebSocketReadyState } from './mocks/MockWebSocket.js'
import { OCPP20ComponentName, OCPPVersion, StandardParametersKey } from '../../src/types/index.js'
import { logger } from '../../src/utils/index.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-import { createMockChargingStation } from './ChargingStationTestUtils.js'
+import { createMockChargingStation } from './helpers/StationHelpers.js'
const TEST_KEY_1 = 'TestKey1'
const MIXED_CASE_KEY = 'MiXeDkEy'
import {
createMockChargingStation,
createMockChargingStationTemplate,
-} from './ChargingStationTestUtils.js'
+} from './helpers/StationHelpers.js'
await describe('Helpers', async () => {
let chargingStationTemplate: ChargingStationTemplate
import { IdTagsCache } from '../../src/charging-station/IdTagsCache.js'
import { IdTagDistribution } from '../../src/types/index.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-import { createMockChargingStation } from './ChargingStationTestUtils.js'
+import { createMockChargingStation } from './helpers/StationHelpers.js'
const TEST_ID_TAGS = ['TAG-001', 'TAG-002', 'TAG-003']
const TEST_ID_TAGS_FILE = 'test-idtags.json'
import { Constants } from '../../../src/utils/index.js'
import { flushMicrotasks, standardCleanup } from '../../helpers/TestLifecycleHelpers.js'
import { TEST_TRANSACTION_ID_STRING } from '../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../helpers/StationHelpers.js'
import { createMockStationWithRequestTracking } from '../ocpp/2.0/OCPP20TestUtils.js'
// ============================================================================
import { Constants } from '../../../../src/utils/index.js'
import { flushMicrotasks, standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
createOCPP16IncomingRequestTestContext,
createOCPP16ListenerStation,
standardCleanup,
} from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME, TEST_ID_TAG } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
/**
* Creates a shared station configured for cross-service integration tests,
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('OCPP 1.6 Request Call Chain — requestHandler → buildRequestPayload → sendMessage', async () => {
let requestService: OCPP16RequestService
import assert from 'node:assert/strict'
import { afterEach, beforeEach, describe, it } from 'node:test'
-import type { MockChargingStation } from '../../ChargingStationTestUtils.js'
+import type { MockChargingStation } from '../../helpers/StationHelpers.js'
import { OCPP16ResponseService } from '../../../../src/charging-station/ocpp/1.6/OCPP16ResponseService.js'
import {
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { dispatchResponse } from './OCPP16TestUtils.js'
/**
OCPPVersion,
} from '../../../../src/types/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { createMeterValuesTemplate } from './OCPP16TestUtils.js'
await describe('OCPP16ServiceUtils — MeterValues', async () => {
} from '../../../../src/types/index.js'
import { standardCleanup, withMockTimers } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_PUBLIC_KEY_HEX } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { createMeterValuesTemplate, upsertConfigurationKey } from './OCPP16TestUtils.js'
await describe('OCPP 1.6 — Signed MeterValues', async () => {
} from '../../../../src/types/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME, TEST_ID_TAG } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { getTestAuthCache } from '../auth/helpers/MockFactories.js'
import { createCommandsSupport } from './OCPP16TestUtils.js'
createMockChargingStation,
type MockChargingStation,
type MockOCPPRequestService,
-} from '../../ChargingStationTestUtils.js'
+} from '../../helpers/StationHelpers.js'
// ============================================================================
// Test Context Types
withMockTimers,
} from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { upsertConfigurationKey } from './OCPP20TestUtils.js'
await describe('OCPP20CertSigningRetryManager', async () => {
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
INVALID_PEM_CERTIFICATE_MISSING_MARKERS,
VALID_CERTIFICATE_CHAIN,
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('C11 - Clear Authorization Data in Authorization Cache', async () => {
afterEach(() => {
import { Constants } from '../../../../src/utils/index.js'
import { flushMicrotasks, standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('N32 - CustomerInformation', async () => {
let station: ChargingStation
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('P01 - DataTransfer', async () => {
let station: ChargingStation
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
createMockCertificateManager,
createStationWithCertificateManager,
TEST_CHARGING_STATION_BASE_NAME,
TEST_FIRMWARE_VERSION,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('B07 - Get Base Report', async () => {
let station: ChargingStation
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
createMockCertificateHashDataChain,
createMockCertificateManager,
withMockTimers,
} from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { createMockStationWithRequestTracking } from './OCPP20TestUtils.js'
await describe('K01 - GetLog', async () => {
standardCleanup,
} from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('D14 - GetTransactionStatus', async () => {
let station: ChargingStation
TEST_CHARGING_STATION_BASE_NAME,
TEST_CONNECTOR_ID_VALID_INSTANCE,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
resetLimits,
resetReportingValueSize,
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
EXPIRED_PEM_CERTIFICATE,
INVALID_PEM_CERTIFICATE_MISSING_MARKERS,
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { upsertConfigurationKey } from './OCPP20TestUtils.js'
await describe('OCPP20IncomingRequestService — LocalAuthList', async () => {
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { createMockAuthService } from '../auth/helpers/MockFactories.js'
import {
resetConnectorTransactionState,
RequestStartStopStatusEnumType,
} from '../../../../src/types/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
-import {
- cleanupChargingStation,
- createMockChargingStation,
-} from '../../ChargingStationTestUtils.js'
+import { cleanupChargingStation, createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('G03 - Remote Start Pre-Authorization', async () => {
let service: OCPP20IncomingRequestService | undefined
import { Constants } from '../../../../src/utils/index.js'
import { flushMicrotasks, standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
createMockAuthorizationResult,
createMockAuthService,
import { Constants } from '../../../../src/utils/index.js'
import { flushMicrotasks, standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { createMockAuthService } from '../auth/helpers/MockFactories.js'
import {
createOCPP20ListenerStation,
OCPP20ResetResponse,
Reservation,
} from '../../../../src/types/index.js'
-import type { MockChargingStation } from '../../ChargingStationTestUtils.js'
+import type { MockChargingStation } from '../../helpers/StationHelpers.js'
import { createTestableIncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/__testable__/index.js'
import { OCPP20IncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.js'
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('B43 - SetNetworkProfile', async () => {
let station: ChargingStation
TEST_CHARGING_STATION_BASE_NAME,
TEST_CONNECTOR_ID_VALID_INSTANCE,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
resetLimits,
resetValueSizeLimits,
OCPP20TriggerMessageResponse,
RequestParams,
} from '../../../../src/types/index.js'
-import type { MockChargingStation } from '../../ChargingStationTestUtils.js'
+import type { MockChargingStation } from '../../helpers/StationHelpers.js'
import { createTestableIncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/__testable__/index.js'
import { OCPP20IncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.js'
import { Constants } from '../../../../src/utils/index.js'
import { flushMicrotasks, standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
/**
* Create a mock station suitable for TriggerMessage tests.
OCPP20UnlockConnectorRequest,
OCPP20UnlockConnectorResponse,
} from '../../../../src/types/index.js'
-import type { MockChargingStation } from '../../ChargingStationTestUtils.js'
+import type { MockChargingStation } from '../../helpers/StationHelpers.js'
import { createTestableIncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/__testable__/index.js'
import { OCPP20IncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.js'
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
/**
* Create a mock station suitable for UnlockConnector tests.
withMockTimers,
} from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
createMockCertificateManager,
createMockStationWithRequestTracking,
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
/** @returns A mock station configured for certificate integration tests */
function createIntegrationStation (): ChargingStation {
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { resetLimits } from './OCPP20TestUtils.js'
/** @returns A mock station configured for integration tests */
TEST_PUBLIC_KEY_HEX,
TEST_TRANSACTION_ID_STRING,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
const energyTemplate: SampledValueTemplate = {
measurand: MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER,
createTestableRequestService,
type SendMessageMock,
type TestableOCPP20RequestService,
-} from '../../../../src/charging-station/ocpp/2.0/__testable__/OCPP20RequestServiceTestable.js'
+} from '../../../../src/charging-station/ocpp/2.0/__testable__/index.js'
import {
ConnectorStatusEnum,
OCPP20ConnectorStatusEnumType,
import { Constants, generateUUID } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('OCPP 2.0 Request Call Chain — requestHandler → buildRequestPayload → sendMessage', async () => {
let service: TestableOCPP20RequestService
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('P02 - DataTransfer', async () => {
let station: ChargingStation
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('J01 - FirmwareStatusNotification', async () => {
let station: ChargingStation
TEST_CHARGING_STATION_BASE_NAME,
TEST_FIRMWARE_VERSION,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
createOCPP20RequestTestContext,
type TestableOCPP20RequestService,
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { createMockOCSPRequestData } from './OCPP20TestUtils.js'
// Sample Base64 EXI request (mock - represents CertificateInstallationReq)
const MOCK_EXI_REQUEST = 'SGVsbG8gV29ybGQgRVhJIFJlcXVlc3Q='
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('M04 - LogStatusNotification', async () => {
let station: ChargingStation
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('G01 - MeterValues', async () => {
let station: ChargingStation
TEST_CHARGING_STATION_BASE_NAME,
TEST_FIRMWARE_VERSION,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('B07/B08 - NotifyReport', async () => {
let testableService: TestableOCPP20RequestService
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('A04 - SecurityEventNotification', async () => {
let station: ChargingStation
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
const MOCK_ORGANIZATION_NAME = 'Test Organization Inc.'
import assert from 'node:assert/strict'
import { afterEach, beforeEach, describe, it, mock } from 'node:test'
-import type { MockChargingStation } from '../../ChargingStationTestUtils.js'
+import type { MockChargingStation } from '../../helpers/StationHelpers.js'
import { buildConfigKey } from '../../../../src/charging-station/index.js'
import { OCPP20ResponseService } from '../../../../src/charging-station/ocpp/2.0/OCPP20ResponseService.js'
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
/**
* Create a mock station suitable for BootNotification response tests.
TEST_CHARGING_STATION_BASE_NAME,
TEST_TOKEN_ISO14443,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { getTestAuthCache } from '../auth/helpers/MockFactories.js'
await describe('C10 - TransactionEventResponse Cache Update', async () => {
import assert from 'node:assert/strict'
import { afterEach, beforeEach, describe, it, mock } from 'node:test'
-import type { MockChargingStation } from '../../ChargingStationTestUtils.js'
+import type { MockChargingStation } from '../../helpers/StationHelpers.js'
import { OCPP20ResponseService } from '../../../../src/charging-station/ocpp/2.0/OCPP20ResponseService.js'
import {
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
/**
* Create a mock station suitable for simple response handler tests.
TEST_CHARGING_STATION_BASE_NAME,
TEST_TRANSACTION_UUID,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
interface TestableOCPP20ResponseService {
handleResponseTransactionEvent: (
TEST_CHARGING_STATION_BASE_NAME,
TEST_TOKEN_ISO14443,
} from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { getTestAuthCache } from '../auth/helpers/MockFactories.js'
await describe('OCPP20ServiceUtils.updateAuthorizationCache', async () => {
} from '../../../../src/types/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import { upsertConfigurationKey } from './OCPP20TestUtils.js'
const DEFAULT_WAIT_MINIMUM_SECONDS = 30
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
await describe('OCPP20ServiceUtils', async () => {
let mockStation: ChargingStation
withMockTimers,
} from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
type CapturedOCPPRequest,
createMockStationWithRequestTracking,
import {
createMockChargingStation,
type MockChargingStation,
-} from '../../ChargingStationTestUtils.js'
+} from '../../helpers/StationHelpers.js'
// ============================================================================
// Testable Interfaces
import { Constants } from '../../../../src/utils/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
resetReportingValueSize,
resetValueSizeLimits,
setupConnectorWithTransaction,
standardCleanup,
} from '../../helpers/TestLifecycleHelpers.js'
-import { createMockChargingStation } from '../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../helpers/StationHelpers.js'
import {
createMockAuthorizationResult,
createMockAuthService,
TEST_TRANSACTION_ID,
TEST_TRANSACTION_ID_STRING,
} from '../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../helpers/StationHelpers.js'
const energyTemplate: SampledValueTemplate = {
measurand: MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER,
} from '../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { OCPPVersion } from '../../../../src/types/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
-import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../helpers/StationHelpers.js'
import {
createMockAuthRequest,
createMockIdentifier,
import { OCPPVersion } from '../../../../../src/types/index.js'
import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
import { TEST_AUTHORIZATION_TIMEOUT_MS } from '../../../ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../../helpers/StationHelpers.js'
await describe('AuthComponentFactory', async () => {
afterEach(() => {
import type { ChargingStation } from '../../src/charging-station/index.js'
import type { MockChargingStationOptions } from '../charging-station/helpers/StationHelpers.js'
-import { createMockChargingStation } from '../charging-station/ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../charging-station/helpers/StationHelpers.js'
import { MockIdTagsCache, MockSharedLRUCache } from '../charging-station/mocks/MockCaches.js'
/**
import {
cleanupChargingStation,
createMockChargingStation,
-} from '../charging-station/ChargingStationTestUtils.js'
+} from '../charging-station/helpers/StationHelpers.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
/**
} from '../../src/utils/ErrorUtils.js'
import { logger } from '../../src/utils/index.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../charging-station/ChargingStationTestConstants.js'
-import { createMockChargingStation } from '../charging-station/ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../charging-station/helpers/StationHelpers.js'
import {
createConsoleMocks,
createLoggerMocks,
import {
cleanupChargingStation,
createMockChargingStation,
-} from '../charging-station/ChargingStationTestUtils.js'
+} from '../charging-station/helpers/StationHelpers.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
await describe('MessageChannelUtils', async () => {
useExecuteAction,
useTemplates,
useUIClient,
+ validateUUID,
} from './Utils'
import type { UIClient } from '@/composables'
import CSConnector from '@/components/charging-stations/CSConnector.vue'
-import { useUIClient } from '@/composables'
-import { EMPTY_VALUE_PLACEHOLDER } from '@/composables/Constants'
+import { EMPTY_VALUE_PLACEHOLDER, useUIClient } from '@/composables'
import { OCPP16ChargePointStatus } from '@/types'
import { toastMock } from '../setup'
import CSConnector from '@/components/charging-stations/CSConnector.vue'
import CSData from '@/components/charging-stations/CSData.vue'
-import { useUIClient } from '@/composables'
-import { EMPTY_VALUE_PLACEHOLDER } from '@/composables/Constants'
+import { EMPTY_VALUE_PLACEHOLDER, useUIClient } from '@/composables'
import { OCPPVersion } from '@/types'
import { toastMock } from '../setup'
*/
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import { UIClient } from '@/composables/UIClient'
+import { UIClient } from '@/composables'
import {
AuthenticationType,
OCPP20TransactionEventEnumType,
setToLocalStorage,
useExecuteAction,
validateUUID,
-} from '@/composables/Utils'
+} from '@/composables'
import { toastMock } from '../setup'