import { DyFM_SocketEvent, DyFM_SocketEvent_Key } from '@futdevpro/fsm-dynamo/socket'; import { DyNTS_SocketClientService_Params } from '../socket/_models/socket-client-service-params.control-model'; import { DyNTS_SocketClient_ServiceBase } from '../socket/_services/socket-client.service'; export class SocketClient_Mock extends DyNTS_SocketClient_ServiceBase { private constructor() { super(); } static getInstance(): SocketClient_Mock { return SocketClient_Mock.getSingletonInstance(); } getIncomingEvents(): DyFM_SocketEvent[] { return [ new DyFM_SocketEvent({ name: 'connect', eventKey: DyFM_SocketEvent_Key.incomingNewConnection, tasks: [ async (content: any, issuer: string) => { console.log('SocketClient_Mock: connect event received'); }, ], }), ]; } getParams(): DyNTS_SocketClientService_Params { return new DyNTS_SocketClientService_Params({ service: '-test-socket-target-', name: 'socket-client-mock', port: 0, socketOptions: { reconnection: true, }, }); } }