]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor(tests): remove deprecated identifier factories
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 28 Feb 2026 21:12:34 +0000 (22:12 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 28 Feb 2026 21:12:34 +0000 (22:12 +0100)
- Migrate createMockOCPP16Identifier to createMockIdentifier
- Migrate createMockOCPP20Identifier to createMockIdentifier
- Delete deprecated functions from MockFactories.ts
- Fix import order in LocalAuthStrategy.test.ts

tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts
tests/charging-station/ocpp/auth/adapters/OCPP16AuthAdapter.test.ts
tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts
tests/charging-station/ocpp/auth/helpers/MockFactories.ts
tests/charging-station/ocpp/auth/strategies/LocalAuthStrategy.test.ts
tests/charging-station/ocpp/auth/strategies/RemoteAuthStrategy.test.ts

index 0b5774591250268bfca9f7c004944155f59cf7a0..d76170d09eb4dd2db24b28e706475e85dda8b0e9 100644 (file)
@@ -16,11 +16,7 @@ import {
 } from '../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
 import { OCPPVersion } from '../../../../src/types/ocpp/OCPPVersion.js'
 import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
-import {
-  createMockAuthRequest,
-  createMockOCPP16Identifier,
-  createMockOCPP20Identifier,
-} from './helpers/MockFactories.js'
+import { createMockAuthRequest, createMockIdentifier } from './helpers/MockFactories.js'
 
 await describe('OCPP Authentication Integration Tests', async () => {
   let mockChargingStation16: ChargingStation
@@ -62,7 +58,7 @@ await describe('OCPP Authentication Integration Tests', async () => {
       const request = createMockAuthRequest({
         connectorId: 1,
         context: AuthContext.TRANSACTION_START,
-        identifier: createMockOCPP16Identifier('VALID_ID_123'),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_16, 'VALID_ID_123'),
       })
 
       const result = await authService.authenticate(request)
@@ -87,7 +83,7 @@ await describe('OCPP Authentication Integration Tests', async () => {
         const request = createMockAuthRequest({
           connectorId: 1,
           context,
-          identifier: createMockOCPP16Identifier(`CONTEXT_TEST_${context}`),
+          identifier: createMockIdentifier(OCPPVersion.VERSION_16, `CONTEXT_TEST_${context}`),
         })
 
         const result = await authService.authenticate(request)
@@ -100,7 +96,7 @@ await describe('OCPP Authentication Integration Tests', async () => {
       const authService = new OCPPAuthServiceImpl(mockChargingStation16)
       const request = createMockAuthRequest({
         connectorId: 1,
-        identifier: createMockOCPP16Identifier('AUTH_DIRECT_TEST'),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_16, 'AUTH_DIRECT_TEST'),
       })
 
       const result = await authService.authorize(request)
@@ -115,7 +111,7 @@ await describe('OCPP Authentication Integration Tests', async () => {
       const request = createMockAuthRequest({
         connectorId: 2,
         context: AuthContext.TRANSACTION_START,
-        identifier: createMockOCPP20Identifier('VALID_ID_456'),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_20, 'VALID_ID_456'),
       })
 
       const result = await authService.authenticate(request)
@@ -139,7 +135,7 @@ await describe('OCPP Authentication Integration Tests', async () => {
         const request = createMockAuthRequest({
           connectorId: 2,
           context,
-          identifier: createMockOCPP20Identifier(`V20_CONTEXT_${context}`),
+          identifier: createMockIdentifier(OCPPVersion.VERSION_20, `V20_CONTEXT_${context}`),
         })
 
         const result = await authService.authenticate(request)
@@ -180,7 +176,7 @@ await describe('OCPP Authentication Integration Tests', async () => {
         const request = createMockAuthRequest({
           connectorId: 1,
           context: i % 2 === 0 ? AuthContext.TRANSACTION_START : AuthContext.TRANSACTION_STOP,
-          identifier: createMockOCPP16Identifier(`CONCURRENT_${String(i)}`),
+          identifier: createMockIdentifier(OCPPVersion.VERSION_16, `CONCURRENT_${String(i)}`),
         })
         promises.push(authService.authenticate(request))
       }
index 75032da5cbc7e4f2e029b72bd68947c7cd28cc43..04b6a08fcbdd77b022ef71eb01f9e5e9b8c7137f 100644 (file)
@@ -18,10 +18,7 @@ import {
 } from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
 import { OCPP16AuthorizationStatus } from '../../../../../src/types/ocpp/1.6/Transaction.js'
 import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
-import {
-  createMockAuthorizationResult,
-  createMockOCPP16Identifier,
-} from '../helpers/MockFactories.js'
+import { createMockAuthorizationResult, createMockIdentifier } from '../helpers/MockFactories.js'
 
 await describe('OCPP16AuthAdapter', async () => {
   let adapter: OCPP16AuthAdapter
@@ -71,7 +68,7 @@ await describe('OCPP16AuthAdapter', async () => {
       const idTag = 'TEST_ID_TAG'
       const result = adapter.convertToUnifiedIdentifier(idTag)
 
-      const expected = createMockOCPP16Identifier(idTag)
+      const expected = createMockIdentifier(OCPPVersion.VERSION_16, idTag)
       expect(result.value).toBe(expected.value)
       expect(result.type).toBe(expected.type)
       expect(result.ocppVersion).toBe(expected.ocppVersion)
@@ -90,7 +87,7 @@ await describe('OCPP16AuthAdapter', async () => {
 
   await describe('convertFromUnifiedIdentifier', async () => {
     await it('should convert unified identifier to OCPP 1.6 idTag', () => {
-      const identifier = createMockOCPP16Identifier('TEST_ID_TAG')
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_16, 'TEST_ID_TAG')
 
       const result = adapter.convertFromUnifiedIdentifier(identifier)
       expect(result).toBe('TEST_ID_TAG')
@@ -99,25 +96,32 @@ await describe('OCPP16AuthAdapter', async () => {
 
   await describe('isValidIdentifier', async () => {
     await it('should validate correct OCPP 1.6 identifier', () => {
-      const identifier = createMockOCPP16Identifier('VALID_TAG')
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_16, 'VALID_TAG')
 
       expect(adapter.isValidIdentifier(identifier)).toBe(true)
     })
 
     await it('should reject identifier with empty value', () => {
-      const identifier = createMockOCPP16Identifier('')
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_16, '')
 
       expect(adapter.isValidIdentifier(identifier)).toBe(false)
     })
 
     await it('should reject identifier exceeding max length (20 chars)', () => {
-      const identifier = createMockOCPP16Identifier('THIS_TAG_IS_TOO_LONG_FOR_OCPP16')
+      const identifier = createMockIdentifier(
+        OCPPVersion.VERSION_16,
+        'THIS_TAG_IS_TOO_LONG_FOR_OCPP16'
+      )
 
       expect(adapter.isValidIdentifier(identifier)).toBe(false)
     })
 
     await it('should reject non-ID_TAG types', () => {
-      const identifier = createMockOCPP16Identifier('TEST_TAG', IdentifierType.CENTRAL)
+      const identifier = createMockIdentifier(
+        OCPPVersion.VERSION_16,
+        'TEST_TAG',
+        IdentifierType.CENTRAL
+      )
 
       expect(adapter.isValidIdentifier(identifier)).toBe(false)
     })
@@ -152,7 +156,7 @@ await describe('OCPP16AuthAdapter', async () => {
 
   await describe('authorizeRemote', async () => {
     await it('should perform remote authorization successfully', async () => {
-      const identifier = createMockOCPP16Identifier('VALID_TAG')
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_16, 'VALID_TAG')
 
       const result = await adapter.authorizeRemote(identifier, 1, 123)
 
@@ -168,7 +172,7 @@ await describe('OCPP16AuthAdapter', async () => {
         return Promise.reject(new Error('Network error'))
       }
 
-      const identifier = createMockOCPP16Identifier('TEST_TAG')
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_16, 'TEST_TAG')
 
       const result = await adapter.authorizeRemote(identifier, 1)
 
index 1871c139d8e573cac492b0638af3e2faf2001bfd..4cd34754e63bdd7fede0e538558065cb52f948f6 100644 (file)
@@ -22,10 +22,7 @@ import {
   RequestStartStopStatusEnumType,
 } from '../../../../../src/types/ocpp/2.0/Transaction.js'
 import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
-import {
-  createMockAuthorizationResult,
-  createMockOCPP20Identifier,
-} from '../helpers/MockFactories.js'
+import { createMockAuthorizationResult, createMockIdentifier } from '../helpers/MockFactories.js'
 
 await describe('OCPP20AuthAdapter', async () => {
   let adapter: OCPP20AuthAdapter
@@ -61,7 +58,7 @@ await describe('OCPP20AuthAdapter', async () => {
       }
 
       const result = adapter.convertToUnifiedIdentifier(idToken)
-      const expected = createMockOCPP20Identifier('TEST_TOKEN')
+      const expected = createMockIdentifier(OCPPVersion.VERSION_20, 'TEST_TOKEN')
 
       expect(result.value).toBe(expected.value)
       expect(result.type).toBe(IdentifierType.ID_TAG)
@@ -71,7 +68,7 @@ await describe('OCPP20AuthAdapter', async () => {
 
     await it('should convert string to unified identifier', () => {
       const result = adapter.convertToUnifiedIdentifier('STRING_TOKEN')
-      const expected = createMockOCPP20Identifier('STRING_TOKEN')
+      const expected = createMockIdentifier(OCPPVersion.VERSION_20, 'STRING_TOKEN')
 
       expect(result.value).toBe(expected.value)
       expect(result.type).toBe(expected.type)
@@ -110,7 +107,11 @@ await describe('OCPP20AuthAdapter', async () => {
 
   await describe('convertFromUnifiedIdentifier', async () => {
     await it('should convert unified identifier to OCPP 2.0 IdToken', () => {
-      const identifier = createMockOCPP20Identifier('CENTRAL_TOKEN', IdentifierType.CENTRAL)
+      const identifier = createMockIdentifier(
+        OCPPVersion.VERSION_20,
+        'CENTRAL_TOKEN',
+        IdentifierType.CENTRAL
+      )
 
       const result = adapter.convertFromUnifiedIdentifier(identifier)
 
@@ -119,7 +120,11 @@ await describe('OCPP20AuthAdapter', async () => {
     })
 
     await it('should map E_MAID type correctly', () => {
-      const identifier = createMockOCPP20Identifier('EMAID_TOKEN', IdentifierType.E_MAID)
+      const identifier = createMockIdentifier(
+        OCPPVersion.VERSION_20,
+        'EMAID_TOKEN',
+        IdentifierType.E_MAID
+      )
 
       const result = adapter.convertFromUnifiedIdentifier(identifier)
 
@@ -128,7 +133,7 @@ await describe('OCPP20AuthAdapter', async () => {
     })
 
     await it('should handle ID_TAG to Local mapping', () => {
-      const identifier = createMockOCPP20Identifier('LOCAL_TAG')
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_20, 'LOCAL_TAG')
 
       const result = adapter.convertFromUnifiedIdentifier(identifier)
 
@@ -138,19 +143,24 @@ await describe('OCPP20AuthAdapter', async () => {
 
   await describe('isValidIdentifier', async () => {
     await it('should validate correct OCPP 2.0 identifier', () => {
-      const identifier = createMockOCPP20Identifier('VALID_TOKEN', IdentifierType.CENTRAL)
+      const identifier = createMockIdentifier(
+        OCPPVersion.VERSION_20,
+        'VALID_TOKEN',
+        IdentifierType.CENTRAL
+      )
 
       expect(adapter.isValidIdentifier(identifier)).toBe(true)
     })
 
     await it('should reject identifier with empty value', () => {
-      const identifier = createMockOCPP20Identifier('', IdentifierType.CENTRAL)
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_20, '', IdentifierType.CENTRAL)
 
       expect(adapter.isValidIdentifier(identifier)).toBe(false)
     })
 
     await it('should reject identifier exceeding max length (36 chars)', () => {
-      const identifier = createMockOCPP20Identifier(
+      const identifier = createMockIdentifier(
+        OCPPVersion.VERSION_20,
         'THIS_TOKEN_IS_DEFINITELY_TOO_LONG_FOR_OCPP20_SPECIFICATION',
         IdentifierType.CENTRAL
       )
@@ -170,7 +180,7 @@ await describe('OCPP20AuthAdapter', async () => {
       ]
 
       for (const type of validTypes) {
-        const identifier = createMockOCPP20Identifier('VALID_TOKEN', type)
+        const identifier = createMockIdentifier(OCPPVersion.VERSION_20, 'VALID_TOKEN', type)
         expect(adapter.isValidIdentifier(identifier)).toBe(true)
       }
     })
@@ -221,7 +231,11 @@ await describe('OCPP20AuthAdapter', async () => {
         })
       )
 
-      const identifier = createMockOCPP20Identifier('VALID_TOKEN', IdentifierType.CENTRAL)
+      const identifier = createMockIdentifier(
+        OCPPVersion.VERSION_20,
+        'VALID_TOKEN',
+        IdentifierType.CENTRAL
+      )
 
       const result = await adapter.authorizeRemote(identifier, 1, 'tx_123')
 
@@ -232,7 +246,7 @@ await describe('OCPP20AuthAdapter', async () => {
     })
 
     await it('should handle invalid token gracefully', async () => {
-      const identifier = createMockOCPP20Identifier('', IdentifierType.CENTRAL)
+      const identifier = createMockIdentifier(OCPPVersion.VERSION_20, '', IdentifierType.CENTRAL)
 
       const result = await adapter.authorizeRemote(identifier, 1)
 
index f3e8a3eca60d0c23f13805752c25010796bcba00..d697765315f60965dbbdca3da0bf0305708c0bea 100644 (file)
@@ -44,38 +44,6 @@ export const createMockIdentifier = (
   value,
 })
 
-/**
- * Create a mock UnifiedIdentifier for OCPP 1.6
- * @param value - Identifier token value (defaults to 'TEST-TAG-001')
- * @param type - Identifier type enum value (defaults to ID_TAG)
- * @returns Mock UnifiedIdentifier configured for OCPP 1.6 protocol
- * @deprecated Use createMockIdentifier(OCPPVersion.VERSION_16, ...) for new code
- */
-export const createMockOCPP16Identifier = (
-  value = 'TEST-TAG-001',
-  type: IdentifierType = IdentifierType.ID_TAG
-): UnifiedIdentifier => ({
-  ocppVersion: OCPPVersion.VERSION_16,
-  type,
-  value,
-})
-
-/**
- * Create a mock UnifiedIdentifier for OCPP 2.0
- * @param value - Identifier token value (defaults to 'TEST-TAG-001')
- * @param type - Identifier type enum value (defaults to ID_TAG)
- * @returns Mock UnifiedIdentifier configured for OCPP 2.0 protocol
- * @deprecated Use createMockIdentifier(OCPPVersion.VERSION_20, ...) for new code
- */
-export const createMockOCPP20Identifier = (
-  value = 'TEST-TAG-001',
-  type: IdentifierType = IdentifierType.ID_TAG
-): UnifiedIdentifier => ({
-  ocppVersion: OCPPVersion.VERSION_20,
-  type,
-  value,
-})
-
 /**
  * Create a mock AuthRequest
  * @param overrides - Partial AuthRequest properties to override defaults
@@ -99,7 +67,6 @@ export const createMockAuthRequest = (overrides?: Partial<AuthRequest>): AuthReq
  * - createMockBlockedAuthorizationResult (BLOCKED)
  * - createMockExpiredAuthorizationResult (EXPIRED)
  * - createMockConcurrentTxAuthorizationResult (CONCURRENT_TX)
- *
  * @param status - Authorization status (defaults to ACCEPTED)
  * @param overrides - Partial AuthorizationResult properties to override defaults
  * @returns Mock AuthorizationResult with specified status from local list method
index 50ae6b7dec5cbcbf31b430b8102905a4dc7bd024..5978dd940153204d1528df2b8abd4377b4f0e6d4 100644 (file)
@@ -17,12 +17,13 @@ import {
   AuthorizationStatus,
   IdentifierType,
 } from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
+import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
 import {
   createMockAuthCache,
   createMockAuthorizationResult,
   createMockAuthRequest,
+  createMockIdentifier,
   createMockLocalAuthListManager,
-  createMockOCPP16Identifier,
   createTestAuthConfig,
 } from '../helpers/MockFactories.js'
 
@@ -67,7 +68,7 @@ await describe('LocalAuthStrategy', async () => {
     await it('should return true when local auth list is enabled', () => {
       const config = createTestAuthConfig({ localAuthListEnabled: true })
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('TEST_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_16, 'TEST_TAG', IdentifierType.ID_TAG),
       })
       expect(strategy.canHandle(request, config)).toBe(true)
     })
@@ -75,7 +76,7 @@ await describe('LocalAuthStrategy', async () => {
     await it('should return true when cache is enabled', () => {
       const config = createTestAuthConfig({ authorizationCacheEnabled: true })
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('TEST_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_16, 'TEST_TAG', IdentifierType.ID_TAG),
       })
       expect(strategy.canHandle(request, config)).toBe(true)
     })
@@ -83,7 +84,7 @@ await describe('LocalAuthStrategy', async () => {
     await it('should return false when nothing is enabled', () => {
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('TEST_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_16, 'TEST_TAG', IdentifierType.ID_TAG),
       })
       expect(strategy.canHandle(request, config)).toBe(false)
     })
@@ -113,7 +114,11 @@ await describe('LocalAuthStrategy', async () => {
         localAuthListEnabled: true,
       })
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('LOCAL_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'LOCAL_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       const result = await strategy.authenticate(request, config)
@@ -135,7 +140,11 @@ await describe('LocalAuthStrategy', async () => {
 
       const config = createTestAuthConfig({ authorizationCacheEnabled: true })
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('CACHED_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'CACHED_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       const result = await strategy.authenticate(request, config)
@@ -150,7 +159,11 @@ await describe('LocalAuthStrategy', async () => {
       const request = createMockAuthRequest({
         allowOffline: true,
         context: AuthContext.TRANSACTION_STOP,
-        identifier: createMockOCPP16Identifier('UNKNOWN_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'UNKNOWN_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       const result = await strategy.authenticate(request, config)
@@ -164,7 +177,11 @@ await describe('LocalAuthStrategy', async () => {
     await it('should return undefined when no local auth available', async () => {
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('UNKNOWN_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'UNKNOWN_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       const result = await strategy.authenticate(request, config)
index 2d57bec1b26a141bc59ac602027928ea47b1f9d1..973b46a103110d588f11387b0034e6006d1e9378 100644 (file)
@@ -20,7 +20,7 @@ import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
 import {
   createMockAuthCache,
   createMockAuthRequest,
-  createMockOCPP16Identifier,
+  createMockIdentifier,
   createMockOCPPAdapter,
   createTestAuthConfig,
 } from '../helpers/MockFactories.js'
@@ -78,7 +78,11 @@ await describe('RemoteAuthStrategy', async () => {
     await it('should return true when remote auth is enabled', () => {
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('REMOTE_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'REMOTE_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
       expect(strategy.canHandle(request, config)).toBe(true)
     })
@@ -89,7 +93,11 @@ await describe('RemoteAuthStrategy', async () => {
         localPreAuthorize: true,
       })
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('REMOTE_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'REMOTE_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
       expect(strategy.canHandle(request, config)).toBe(false)
     })
@@ -98,7 +106,11 @@ await describe('RemoteAuthStrategy', async () => {
       const strategyNoAdapters = new RemoteAuthStrategy()
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('REMOTE_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'REMOTE_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
       expect(strategyNoAdapters.canHandle(request, config)).toBe(false)
     })
@@ -113,7 +125,11 @@ await describe('RemoteAuthStrategy', async () => {
     await it('should authenticate using OCPP 1.6 adapter', async () => {
       const config = createTestAuthConfig({ authorizationCacheEnabled: true })
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('REMOTE_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'REMOTE_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       const result = await strategy.authenticate(request, config)
@@ -152,7 +168,11 @@ await describe('RemoteAuthStrategy', async () => {
         authorizationCacheLifetime: 300,
       })
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('CACHE_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'CACHE_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       await strategy.authenticate(request, config)
@@ -164,7 +184,11 @@ await describe('RemoteAuthStrategy', async () => {
 
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('UNAVAILABLE_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'UNAVAILABLE_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       const result = await strategy.authenticate(request, config)
@@ -192,7 +216,11 @@ await describe('RemoteAuthStrategy', async () => {
 
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('ERROR_TAG', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(
+          OCPPVersion.VERSION_16,
+          'ERROR_TAG',
+          IdentifierType.ID_TAG
+        ),
       })
 
       const result = await strategy.authenticate(request, config)
@@ -207,7 +235,7 @@ await describe('RemoteAuthStrategy', async () => {
 
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('TEST', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_16, 'TEST', IdentifierType.ID_TAG),
       })
 
       expect(newStrategy.canHandle(request, config)).toBe(true)
@@ -218,7 +246,7 @@ await describe('RemoteAuthStrategy', async () => {
 
       const config = createTestAuthConfig()
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('TEST', IdentifierType.ID_TAG),
+        identifier: createMockIdentifier(OCPPVersion.VERSION_16, 'TEST', IdentifierType.ID_TAG),
       })
 
       expect(strategy.canHandle(request, config)).toBe(false)