diff --git a/src/app.module.ts b/src/app.module.ts index 9d4062a4..5e778618 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -11,7 +11,6 @@ import { EscrowAccounts } from '@common/escrow/models/deposit.entity'; import { IndexerModule } from '@indexer/indexer.module'; import { SubstrateListenerModule } from '@listeners/substrate-listener/substrate-listener.module'; import { SchedulersModule } from '@schedulers/schedulers.module'; -import { keyList, SecretKeyList } from '@common/secrets'; import { config } from './config'; // eslint-disable-next-line @typescript-eslint/no-var-requires @@ -29,9 +28,7 @@ require('dotenv').config(); }), ], inject: [ProcessEnvProxy], - useFactory: async ( - processEnvProxy: ProcessEnvProxy, - ) => { + useFactory: async (processEnvProxy: ProcessEnvProxy) => { return { type: 'postgres', host: processEnvProxy.env.HOST_POSTGRES, @@ -54,9 +51,7 @@ require('dotenv').config(); }), ], inject: [ProcessEnvProxy], - useFactory: async ( - processEnvProxy: ProcessEnvProxy, - ) => { + useFactory: async (processEnvProxy: ProcessEnvProxy) => { return { type: 'postgres', host: processEnvProxy.env.HOST_POSTGRES, diff --git a/src/common/caches/index.ts b/src/common/caches/index.ts index 712524d2..eb8ceb02 100644 --- a/src/common/caches/index.ts +++ b/src/common/caches/index.ts @@ -1,7 +1,7 @@ import { CacheModule, Module } from '@nestjs/common'; import { CachesService } from './caches.service'; import * as redisStore from 'cache-manager-redis-store'; -import { config } from 'src/config'; +import { config } from '../../config'; require('dotenv').config(); // eslint-disable-line @@ -10,8 +10,7 @@ require('dotenv').config(); // eslint-disable-line CacheModule.registerAsync({ imports: [], inject: [], - useFactory: async ( - ) => { + useFactory: async () => { return { store: redisStore, host: config.REDIS_HOST.toString(), diff --git a/src/common/common.module.ts b/src/common/common.module.ts index 59a4d10b..dc94a2c5 100644 --- a/src/common/common.module.ts +++ b/src/common/common.module.ts @@ -11,8 +11,7 @@ require('dotenv').config(); ElasticsearchModule.registerAsync({ imports: [], inject: [], - useFactory: async ( - ) => ({ + useFactory: async () => ({ node: config.ELASTICSEARCH_NODE.toString(), auth: { username: config.ELASTICSEARCH_USERNAME.toString(), diff --git a/src/common/debio-conversion/debio-conversion.module.ts b/src/common/debio-conversion/debio-conversion.module.ts index 9d01e52c..159c384b 100644 --- a/src/common/debio-conversion/debio-conversion.module.ts +++ b/src/common/debio-conversion/debio-conversion.module.ts @@ -2,8 +2,7 @@ import { Module } from '@nestjs/common'; import { DebioConversionService } from './debio-conversion.service'; @Module({ - imports: [ - ], + imports: [], providers: [DebioConversionService], exports: [DebioConversionService], }) diff --git a/src/common/debio-conversion/debio-conversion.service.ts b/src/common/debio-conversion/debio-conversion.service.ts index 53395fd3..20b76a2e 100644 --- a/src/common/debio-conversion/debio-conversion.service.ts +++ b/src/common/debio-conversion/debio-conversion.service.ts @@ -1,12 +1,10 @@ import { Injectable, Logger } from '@nestjs/common'; import axios from 'axios'; -import { config } from 'src/config'; +import { config } from '../../config'; @Injectable() export class DebioConversionService { private readonly logger: Logger = new Logger(DebioConversionService.name); - constructor( - ) {} async getExchange() { try { diff --git a/src/common/ethereum/ethereum.module.ts b/src/common/ethereum/ethereum.module.ts index 9c718c33..9aecbd96 100644 --- a/src/common/ethereum/ethereum.module.ts +++ b/src/common/ethereum/ethereum.module.ts @@ -16,8 +16,7 @@ import { config } from '../../config'; }), ], inject: [], - useFactory: async ( - ) => { + useFactory: async () => { return { network: config.WEB3_RPC_HTTPS.toString(), useDefaultProvider: true, diff --git a/src/common/mailer/mailer.manager.ts b/src/common/mailer/mailer.manager.ts index 9e58e726..d7d70d34 100644 --- a/src/common/mailer/mailer.manager.ts +++ b/src/common/mailer/mailer.manager.ts @@ -8,9 +8,7 @@ import { config } from '../../config'; @Injectable() export class MailerManager { private readonly _logger: Logger = new Logger(MailerManager.name); - constructor( - private readonly mailerService: MailerService, - ) {} + constructor(private readonly mailerService: MailerService) {} async sendNewOrderToLab(to: string, context: NewOrderLab) { const subject = `New Order #1`; @@ -37,10 +35,7 @@ export class MailerManager { context: CustomerStakingRequestService, ) { let subject = `New Service Request - ${context.service_name} - ${context.city}, ${context.state}, ${context.country}`; - if ( - config.POSTGRES_HOST.toString() === - 'localhost' - ) { + if (config.POSTGRES_HOST.toString() === 'localhost') { subject = `Testing New Service Request Email`; } this.mailerService.sendMail({ @@ -53,10 +48,7 @@ export class MailerManager { async sendLabRegistrationEmail(to: string | string[], context: LabRegister) { let subject = `New Lab Register – ${context.lab_name} - ${context.city}, ${context.state}, ${context.country}`; - if ( - config.POSTGRES_HOST.toString() === - 'localhost' - ) { + if (config.POSTGRES_HOST.toString() === 'localhost') { subject = `Testing New Lab Register Email`; } const files: any[] = []; diff --git a/src/common/mailer/mailer.module.ts b/src/common/mailer/mailer.module.ts index 219605c2..8f7aca84 100644 --- a/src/common/mailer/mailer.module.ts +++ b/src/common/mailer/mailer.module.ts @@ -8,11 +8,9 @@ import { config } from '../../config'; @Module({ imports: [ MailerModule.forRootAsync({ - imports: [ - ], + imports: [], inject: [], - useFactory: async ( - ) => { + useFactory: async () => { return { transport: { host: 'smtp.gmail.com', diff --git a/src/common/substrate/index.ts b/src/common/substrate/index.ts index e380ae17..ccc9b494 100644 --- a/src/common/substrate/index.ts +++ b/src/common/substrate/index.ts @@ -2,8 +2,7 @@ import { Module } from '@nestjs/common'; import { SubstrateService } from './substrate.service'; @Module({ - imports: [ - ], + imports: [], providers: [SubstrateService], exports: [SubstrateService], }) diff --git a/src/common/substrate/substrate.service.ts b/src/common/substrate/substrate.service.ts index 8e6278af..6610a1fb 100644 --- a/src/common/substrate/substrate.service.ts +++ b/src/common/substrate/substrate.service.ts @@ -11,9 +11,6 @@ export class SubstrateService implements OnModuleInit { private _listenStatus: boolean; private readonly _logger: Logger = new Logger(SubstrateService.name); - constructor( - ) {} - get api(): ApiPromise { return this._api; } @@ -23,9 +20,7 @@ export class SubstrateService implements OnModuleInit { } async onModuleInit() { - this._wsProvider = new WsProvider( - config.SUBSTRATE_URL.toString(), - ); + this._wsProvider = new WsProvider(config.SUBSTRATE_URL.toString()); const keyring = new Keyring({ type: 'sr25519' }); await waitReady(); diff --git a/src/config.ts b/src/config.ts index dbe507e2..e33cdc97 100644 --- a/src/config.ts +++ b/src/config.ts @@ -35,9 +35,10 @@ export const config = { MYRIAD_MENTAL_HEALTH_TIMELINE_ID: process.env.MENTAL_HEALTH_EXPERIENCE_ID ?? '', PINATA_JWT: process.env.PINATA_SECRET_KEY ?? '', - GA_ORDER_LINK : process.env.GA_ORDER_LINK ?? '', - LAB_ORDER_LINK : process.env.LAB_ORDER_LINK ?? '', - UNSTAKE_INTERVAL : process.env.UNSTAKE_INTERVAL ?? '', - UNSTAKE_TIMER : process.env.UNSTAKE_TIMER ?? '', - MENSTRUAL_SUBSCRIPTION_DURATION : process.env.MENSTRUAL_SUBSCRIPTION_DURATION ?? '', + GA_ORDER_LINK: process.env.GA_ORDER_LINK ?? '', + LAB_ORDER_LINK: process.env.LAB_ORDER_LINK ?? '', + UNSTAKE_INTERVAL: process.env.UNSTAKE_INTERVAL ?? '', + UNSTAKE_TIMER: process.env.UNSTAKE_TIMER ?? '', + MENSTRUAL_SUBSCRIPTION_DURATION: + process.env.MENSTRUAL_SUBSCRIPTION_DURATION ?? '', }; diff --git a/src/indexer/indexer.handler.ts b/src/indexer/indexer.handler.ts index 4f6ef009..77fe357d 100644 --- a/src/indexer/indexer.handler.ts +++ b/src/indexer/indexer.handler.ts @@ -57,9 +57,7 @@ export class IndexerHandler delete this.wsProvider; } - this.wsProvider = new WsProvider( - config.SUBSTRATE_URL.toString(), - ); + this.wsProvider = new WsProvider(config.SUBSTRATE_URL.toString()); this.wsProvider.on('connected', () => { this.logger.log(`WS Connected`); diff --git a/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts b/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts index 0c71f3e4..c3f46b7e 100644 --- a/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts +++ b/src/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.ts @@ -96,7 +96,7 @@ export class GeneticAnalysisOrderPaidHandler ); const linkOrder = - config.GA_ORDER_LINK ?.toString() ?? '' + geneticAnalysisOrder.id; + config.GA_ORDER_LINK?.toString() ?? '' + geneticAnalysisOrder.id; await this.mailerManager.sendNewOrderToGa( geneticAnaystDetail.info.email, diff --git a/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts b/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts index 7e05a791..0567413a 100644 --- a/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts +++ b/src/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.ts @@ -99,8 +99,7 @@ export class OrderPaidHandler implements ICommandHandler { order.serviceId, ); - const linkOrder = - config.LAB_ORDER_LINK.toString() ?? '' + order.id; + const linkOrder = config.LAB_ORDER_LINK.toString() ?? '' + order.id; await this.mailerManager.sendNewOrderToLab(labDetail.info.email, { specimen_number: order.dnaSampleTrackingId, diff --git a/src/listeners/substrate-listener/substrate-listener.module.ts b/src/listeners/substrate-listener/substrate-listener.module.ts index b15f6df9..21fb7722 100644 --- a/src/listeners/substrate-listener/substrate-listener.module.ts +++ b/src/listeners/substrate-listener/substrate-listener.module.ts @@ -42,11 +42,9 @@ import { config } from '../../config'; DateTimeModule, NotificationModule, ElasticsearchModule.registerAsync({ - imports: [ - ], + imports: [], inject: [], - useFactory: async ( - ) => { + useFactory: async () => { return { node: config.ELASTICSEARCH_NODE.toString(), auth: { @@ -57,11 +55,9 @@ import { config } from '../../config'; }, }), MailerModule.forRootAsync({ - imports: [ - ], + imports: [], inject: [], - useFactory: async ( - ) => { + useFactory: async () => { return { transport: { host: 'smtp.gmail.com', diff --git a/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts b/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts index 84068ccf..072d65ee 100644 --- a/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts +++ b/src/schedulers/genetic-analyst-unstaked/unstaked.service.ts @@ -20,9 +20,7 @@ export class GeneticAnalystUnstakedService implements OnModuleInit { ) {} onModuleInit() { - this.timer = strToMilisecond( - config.UNSTAKE_TIMER.toString(), - ); + this.timer = strToMilisecond(config.UNSTAKE_TIMER.toString()); const unstakeInterval: number = strToMilisecond( config.UNSTAKE_INTERVAL.toString(), ); diff --git a/src/schedulers/lab-unstake/lab-unstake.service.ts b/src/schedulers/lab-unstake/lab-unstake.service.ts index 94cfb77c..00d6df8c 100644 --- a/src/schedulers/lab-unstake/lab-unstake.service.ts +++ b/src/schedulers/lab-unstake/lab-unstake.service.ts @@ -20,9 +20,7 @@ export class LabUnstakedService implements OnModuleInit { ) {} onModuleInit() { - this.timer = strToMilisecond( - config.UNSTAKE_TIMER.toString(), - ); + this.timer = strToMilisecond(config.UNSTAKE_TIMER.toString()); const unstakeInterval: number = strToMilisecond( config.UNSTAKE_INTERVAL.toString(), ); diff --git a/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts b/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts index c988c040..d2d8d389 100644 --- a/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts +++ b/src/schedulers/menstrual-subscription/menstrual-subscription.service.ts @@ -235,9 +235,7 @@ export class MenstrualSubscriptionService { parseMenstrualSubscriptionDuration(): { [key: string]: number } { try { const menstrualSubscriptionDurationObj: { [key: string]: string } = - JSON.parse( - config.MENSTRUAL_SUBSCRIPTION_DURATION.toString() ?? '{}', - ); + JSON.parse(config.MENSTRUAL_SUBSCRIPTION_DURATION.toString() ?? '{}'); const parseMenstrualSubscriptionDuration: Map = new Map< string, number diff --git a/src/schedulers/schedulers.module.ts b/src/schedulers/schedulers.module.ts index 9df4ba22..4cc5f79b 100644 --- a/src/schedulers/schedulers.module.ts +++ b/src/schedulers/schedulers.module.ts @@ -15,11 +15,9 @@ import { config } from '../config'; @Module({ imports: [ ElasticsearchModule.registerAsync({ - imports: [ - ], + imports: [], inject: [], - useFactory: async ( - ) => { + useFactory: async () => { return { node: config.ELASTICSEARCH_NODE.toString(), auth: { diff --git a/src/schedulers/unstaked/unstaked.service.ts b/src/schedulers/unstaked/unstaked.service.ts index f4b27666..675e2cf9 100644 --- a/src/schedulers/unstaked/unstaked.service.ts +++ b/src/schedulers/unstaked/unstaked.service.ts @@ -21,9 +21,7 @@ export class UnstakedService implements OnModuleInit { ) {} onModuleInit() { - this.timer = strToMilisecond( - config.UNSTAKE_TIMER.toString(), - ); + this.timer = strToMilisecond(config.UNSTAKE_TIMER.toString()); const unstakeInterval: number = strToMilisecond( config.UNSTAKE_INTERVAL.toString(), ); diff --git a/test/e2e/indexer/events/certification-events.spec.ts b/test/e2e/indexer/events/certification-events.spec.ts index 284b41f1..a83a9f84 100644 --- a/test/e2e/indexer/events/certification-events.spec.ts +++ b/test/e2e/indexer/events/certification-events.spec.ts @@ -42,26 +42,6 @@ describe('Certification Event', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -76,8 +56,7 @@ describe('Certification Event', () => { ...LabCommandHandlers, ...CertificationsCommandHandlers, ], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analysis-events.spec.ts b/test/e2e/indexer/events/genetic-analysis-events.spec.ts index 78e7b5d2..27749e19 100644 --- a/test/e2e/indexer/events/genetic-analysis-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analysis-events.spec.ts @@ -30,7 +30,6 @@ import { CommonModule, ProcessEnvModule } from '@common/index'; import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystServiceDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analysis Events', () => { let app: INestApplication; @@ -50,26 +49,6 @@ describe('Genetic Analysis Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -80,8 +59,7 @@ describe('Genetic Analysis Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts b/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts index 7daf04e4..f4ea6940 100644 --- a/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts @@ -37,7 +37,6 @@ import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystServiceDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analysis Events', () => { let app: INestApplication; @@ -58,26 +57,6 @@ describe('Genetic Analysis Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -88,8 +67,7 @@ describe('Genetic Analysis Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analyst-events.spec.ts b/test/e2e/indexer/events/genetic-analyst-events.spec.ts index 6d35867f..403e38c9 100644 --- a/test/e2e/indexer/events/genetic-analyst-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-events.spec.ts @@ -26,7 +26,6 @@ import { geneticAnalystsDataMock } from '../../../mock/models/genetic-analysts/g import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { AvailabilityStatus } from '@debionetwork/polkadot-provider/lib/primitives/availability-status'; import { StakeStatus } from '@indexer/models/stake-status'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Events', () => { let app: INestApplication; @@ -45,26 +44,6 @@ describe('Genetic Analyst Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -75,8 +54,7 @@ describe('Genetic Analyst Events', () => { IndexerModule, ], providers: [IndexerHandler, ...GeneticAnalystsCommandHandlers], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts b/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts index c199f784..59dd1478 100644 --- a/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts @@ -18,7 +18,6 @@ import { CommonModule, ProcessEnvModule } from '@common/index'; import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystQualificationsDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-qualifications.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Qualification Events', () => { let app: INestApplication; @@ -37,26 +36,6 @@ describe('Genetic Analyst Qualification Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -67,8 +46,7 @@ describe('Genetic Analyst Qualification Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts b/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts index d17bd029..1ae2f785 100644 --- a/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts @@ -22,7 +22,6 @@ import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { geneticAnalystsDataMock } from '../../../mock/models/genetic-analysts/genetic-analysts.mock'; import { geneticAnalystServiceDataMock } from '../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Service Events', () => { let app: INestApplication; @@ -42,26 +41,6 @@ describe('Genetic Analyst Service Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -72,8 +51,7 @@ describe('Genetic Analyst Service Events', () => { IndexerModule, ], providers: [IndexerHandler], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-data-events.spec.ts b/test/e2e/indexer/events/genetic-data-events.spec.ts index ffd76c58..b13db9cd 100644 --- a/test/e2e/indexer/events/genetic-data-events.spec.ts +++ b/test/e2e/indexer/events/genetic-data-events.spec.ts @@ -17,7 +17,6 @@ import { GeneticDataCommandHandlers } from '@indexer/events/genetic-data'; import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { initializeApi } from '../../polkadot-init'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Data Events', () => { let app: INestApplication; @@ -41,26 +40,6 @@ describe('Genetic Data Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -71,8 +50,7 @@ describe('Genetic Data Events', () => { IndexerModule, ], providers: [IndexerHandler, ...GeneticDataCommandHandlers], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/genetic-testing-events.spec.ts b/test/e2e/indexer/events/genetic-testing-events.spec.ts index 4c078605..d7563605 100644 --- a/test/e2e/indexer/events/genetic-testing-events.spec.ts +++ b/test/e2e/indexer/events/genetic-testing-events.spec.ts @@ -61,8 +61,7 @@ describe('Indexer Genetic Testing Event', () => { IndexerModule, ], providers: [IndexerHandler, ...GeneticTestingCommandHandlers], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/labs-events.spec.ts b/test/e2e/indexer/events/labs-events.spec.ts index 0ba67098..4d2c3cb6 100644 --- a/test/e2e/indexer/events/labs-events.spec.ts +++ b/test/e2e/indexer/events/labs-events.spec.ts @@ -24,7 +24,6 @@ import { IndexerModule } from '@indexer/indexer.module'; import { LabCommandHandlers } from '@indexer/events/labs'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { StakeStatus } from '@indexer/models/stake-status'; -import { SecretKeyList } from '@common/secrets'; describe('Event Command Service Request Claimed', () => { let app: INestApplication; @@ -43,26 +42,6 @@ describe('Event Command Service Request Claimed', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -73,8 +52,7 @@ describe('Event Command Service Request Claimed', () => { IndexerModule, ], providers: [IndexerHandler, ...LabCommandHandlers], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/menstrual-calendar-events.spec.ts b/test/e2e/indexer/events/menstrual-calendar-events.spec.ts index 6d0328e6..e69d651d 100644 --- a/test/e2e/indexer/events/menstrual-calendar-events.spec.ts +++ b/test/e2e/indexer/events/menstrual-calendar-events.spec.ts @@ -3,7 +3,6 @@ import { ApiPromise } from '@polkadot/api'; // import { MenstrualCycleLog } from '@indexer/models/menstrual-calendar/menstrual-cycle-log'; // import { MenstrualCalendar } from '@indexer/models/menstrual-calendar/menstrual-calendar'; import { Test, TestingModule } from '@nestjs/testing'; -import { SecretKeyList } from '@common/secrets'; import { CommonModule, ProcessEnvModule } from '@common/index'; import { CqrsModule } from '@nestjs/cqrs'; import { ScheduleModule } from '@nestjs/schedule'; @@ -33,26 +32,6 @@ describe('Menstrual Calendar Test Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -63,8 +42,7 @@ describe('Menstrual Calendar Test Events', () => { IndexerModule, ], providers: [IndexerHandler, ...MenstrualCalendarCommandHandlers], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/orders-events.spec.ts b/test/e2e/indexer/events/orders-events.spec.ts index 6ecc810a..dd147c54 100644 --- a/test/e2e/indexer/events/orders-events.spec.ts +++ b/test/e2e/indexer/events/orders-events.spec.ts @@ -28,7 +28,6 @@ import { } from '@debionetwork/polkadot-provider'; import { OrderCommandHandlers } from '@indexer/events/orders'; import { DnaSample } from '@debionetwork/polkadot-provider/lib/models/labs/genetic-testing/dna-sample'; -import { SecretKeyList } from '@common/secrets'; describe('Orders Events', () => { let app: INestApplication; @@ -47,26 +46,6 @@ describe('Orders Events', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -77,8 +56,7 @@ describe('Orders Events', () => { IndexerModule, ], providers: [IndexerHandler, ...OrderCommandHandlers], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/service-events.spec.ts b/test/e2e/indexer/events/service-events.spec.ts index 0a5ab712..57800b44 100644 --- a/test/e2e/indexer/events/service-events.spec.ts +++ b/test/e2e/indexer/events/service-events.spec.ts @@ -21,7 +21,6 @@ import { IndexerHandler } from '@indexer/indexer.handler'; import { IndexerModule } from '@indexer/indexer.module'; import { labDataMock } from '../../../mock/models/labs/labs.mock'; import { serviceDataMock } from '../../../mock/models/labs/services.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Service Event', () => { let app: INestApplication; @@ -41,26 +40,6 @@ describe('Service Event', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -75,8 +54,7 @@ describe('Service Event', () => { ...LabCommandHandlers, ...ServiceCommandHandlers, ], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); diff --git a/test/e2e/indexer/events/service-request-events.spec.ts b/test/e2e/indexer/events/service-request-events.spec.ts index 7b48822e..ab391ab1 100644 --- a/test/e2e/indexer/events/service-request-events.spec.ts +++ b/test/e2e/indexer/events/service-request-events.spec.ts @@ -54,26 +54,6 @@ describe('Event Command Service Request Claimed', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -89,8 +69,7 @@ describe('Event Command Service Request Claimed', () => { ...ServiceCommandHandlers, ...RequestServiceCommandHandlers, ], - }) - .compile(); + }).compile(); elasticsearchService = module.get(ElasticsearchService); @@ -252,19 +231,11 @@ describe('Event Command Service Request Claimed', () => { const claimRequestPromise: Promise = new Promise( // eslint-disable-next-line (resolve, reject) => { - claimRequest( - api, - pair, - serviceRequest.hash, - service.id, - '900000000000000000', - '100000000000000000', - () => { - queryServiceRequestById(api, serviceRequest.hash).then((res) => { - resolve(res); - }); - }, - ); + claimRequest(api, pair, serviceRequest.hash, service.id, () => { + queryServiceRequestById(api, serviceRequest.hash).then((res) => { + resolve(res); + }); + }); }, ); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts index 2d09340c..483aa2d6 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-events.spec.ts @@ -64,7 +64,7 @@ import { GeneticAnalysisOrderPaidHandler } from '@listeners/substrate-listener/c import { MailerModule } from '@nestjs-modules/mailer'; import { join } from 'path'; import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; -import { config } from 'src/config'; +import { config } from '../../../../../../src/config'; describe('Genetic Analysis Order Created Integration Test', () => { let app: INestApplication; @@ -81,26 +81,6 @@ describe('Genetic Analysis Order Created Integration Test', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -118,11 +98,9 @@ describe('Genetic Analysis Order Created Integration Test', () => { DateTimeModule, NotificationModule, MailerModule.forRootAsync({ - imports: [ - ], + imports: [], inject: [], - useFactory: async ( - ) => { + useFactory: async () => { return { transport: { host: 'smtp.gmail.com', @@ -159,8 +137,7 @@ describe('Genetic Analysis Order Created Integration Test', () => { GeneticAnalysisOrderFulfilledHandler, GeneticAnalysisOrderPaidHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts index f359d7bc..438a33cb 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-events.spec.ts @@ -68,26 +68,6 @@ describe('Genetic Analysis Order Created Integration Test', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -119,8 +99,7 @@ describe('Genetic Analysis Order Created Integration Test', () => { SubstrateListenerHandler, GeneticAnalysisRejectedHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts index 4e1b5812..db363217 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analyst-service/genetic-analyst-service-events.spec.ts @@ -55,26 +55,6 @@ describe('Genetic Analyst Service Created Event', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -99,8 +79,7 @@ describe('Genetic Analyst Service Created Event', () => { SubstrateListenerHandler, ...GeneticAnalystServiceCommandHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts index 70703956..36e5fe46 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-events.spec.ts @@ -49,26 +49,6 @@ describe('Genetic analyst verification status', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -95,8 +75,7 @@ describe('Genetic analyst verification status', () => { GeneticAnalystRegisteredHandler, GeneticAnalystVerificationStatusHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts index 2a542925..5c4840d3 100644 --- a/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/genetic-testing/genetic-testing-events.spec.ts @@ -59,7 +59,6 @@ import { SubstrateListenerHandler } from '@listeners/substrate-listener/substrat import { createConnection } from 'typeorm'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { DataStakedHandler } from '@listeners/substrate-listener/commands/genetic-testing/data-staked/data-staked.handler'; -import { SecretKeyList } from '@common/secrets'; import { DnaSample } from '@debionetwork/polkadot-provider/lib/models/labs/genetic-testing/dna-sample'; import { Notification } from '@common/notification/models/notification.entity'; import { DnaSampleRejectedCommandHandler } from '@listeners/substrate-listener/commands/genetic-testing/dna-sample-rejected/dna-sample-rejected.handler'; @@ -80,29 +79,6 @@ describe('Data Staked Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['REDIS_STORE_URL', process.env.REDIS_STORE_URL], - ['REDIS_STORE_USERNAME', process.env.REDIS_STORE_USERNAME], - ['REDIS_STORE_PASSWORD', process.env.REDIS_STORE_PASSWORD], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -131,8 +107,7 @@ describe('Data Staked Integration Tests', () => { DnaSampleRejectedCommandHandler, DnaSampleResultReadyCommandHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts index 275700e6..2e4a9f91 100644 --- a/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/labs/labs-events.spec.ts @@ -53,23 +53,6 @@ describe('lab staking Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -97,8 +80,7 @@ describe('lab staking Integration Tests', () => { labUnstakedHandler, LabUpdateVerificationStatusHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts index 85e98054..bfb5d8eb 100644 --- a/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/orders/orders-events.spec.ts @@ -82,28 +82,6 @@ describe('Order Failed Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['LAB_ORDER_LINK', process.env.LAB_ORDER_LINK], - ['POSTGRES_HOST', process.env.POSTGRES_HOST], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -122,15 +100,10 @@ describe('Order Failed Integration Tests', () => { NotificationModule, DebioConversionModule, MailerModule.forRootAsync({ - imports: [ - ], + imports: [], inject: [], - useFactory: async ( - ) => { - console.log( - config.EMAIL.toString(), - config.PASS_EMAIL.toString(), - ); + useFactory: async () => { + console.log(config.EMAIL.toString(), config.PASS_EMAIL.toString()); return { transport: { host: 'smtp.gmail.com', @@ -168,8 +141,7 @@ describe('Order Failed Integration Tests', () => { OrderFulfilledHandler, OrderPaidHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts index 4ad5de63..98e97df5 100644 --- a/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/service-request/service-request-events.spec.ts @@ -66,26 +66,6 @@ describe('Service Request Excess Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ @@ -113,8 +93,7 @@ describe('Service Request Excess Integration Tests', () => { ServiceRequestStakingAmountExcessRefunded, ServiceRequestStakingAmountRefundedHandler, ], - }) - .compile(); + }).compile(); app = module.createNestApplication(); await app.init(); diff --git a/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts b/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts index bf7168e9..529f8929 100644 --- a/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts +++ b/test/e2e/listeners/substrate-listener/commands/services/services-events.spec.ts @@ -51,28 +51,6 @@ describe('Service Created Integration Tests', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['POSTGRES_HOST', 'localhost'], - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['EMAILS', process.env.EMAILS], - ]); - - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const modules: TestingModule = await Test.createTestingModule({ imports: [ @@ -99,8 +77,7 @@ describe('Service Created Integration Tests', () => { SubstrateListenerHandler, ...ServiceCommandHandlers, ], - }) - .compile(); + }).compile(); app = modules.createNestApplication(); await app.init(); diff --git a/test/e2e/schedulers/lab-unstake.spec.ts b/test/e2e/schedulers/lab-unstake.spec.ts index 073f139b..60c6a931 100644 --- a/test/e2e/schedulers/lab-unstake.spec.ts +++ b/test/e2e/schedulers/lab-unstake.spec.ts @@ -25,24 +25,6 @@ describe('Lab Unstaked Scheduler (e2e)', () => { let app: INestApplication; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['UNSTAKE_TIMER', process.env.UNSTAKE_TIMER], - ['UNSTAKE_INTERVAL', process.env.UNSTAKE_INTERVAL], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - global.console = { ...console, log: jest.fn(), @@ -57,8 +39,7 @@ describe('Lab Unstaked Scheduler (e2e)', () => { imports: [ ElasticsearchModule.registerAsync({ inject: [], - useFactory: async ( - ) => ({ + useFactory: async () => ({ node: process.env.ELASTICSEARCH_NODE, auth: { username: config.ELASTICSEARCH_USERNAME.toString(), @@ -70,8 +51,7 @@ describe('Lab Unstaked Scheduler (e2e)', () => { SubstrateModule, ScheduleModule.forRoot(), ], - }) - .compile(); + }).compile(); schedulerRegistry = module.get(SchedulerRegistry); substrateService = module.get(SubstrateService); diff --git a/test/e2e/schedulers/mailer.spec.ts b/test/e2e/schedulers/mailer.spec.ts index ce846b59..798f030c 100644 --- a/test/e2e/schedulers/mailer.spec.ts +++ b/test/e2e/schedulers/mailer.spec.ts @@ -37,41 +37,13 @@ describe('Mailer Scheduler (e2e)', () => { error: jest.fn(), }; - class GoogleSecretManagerServiceMock { - async accessSecret() { - return null; - } - _secretsList = new Map([ - ['POSTGRES_HOST', 'localhost'], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ELASTICSEARCH_NODE', process.env.ELASTICSEARCH_NODE], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['EMAIL', process.env.EMAIL], - ['PASS_EMAIL', process.env.PASS_EMAIL], - ['UNSTAKE_TIMER', process.env.UNSTAKE_TIMER], - ['UNSTAKE_INTERVAL', process.env.UNSTAKE_INTERVAL], - ['EMAILS', process.env.EMAILS], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ ProcessEnvModule, ElasticsearchModule.registerAsync({ inject: [], - useFactory: async ( - ) => ({ + useFactory: async () => ({ node: process.env.ELASTICSEARCH_NODE, auth: { username: config.ELASTICSEARCH_USERNAME.toString(), @@ -90,8 +62,7 @@ describe('Mailer Scheduler (e2e)', () => { MailModule, EmailNotificationModule, ], - }) - .compile(); + }).compile(); mailerManager = module.get(MailerManager); substrateService = module.get(SubstrateService); diff --git a/test/e2e/schedulers/unstaked.spec.ts b/test/e2e/schedulers/unstaked.spec.ts index b65ff494..a175c147 100644 --- a/test/e2e/schedulers/unstaked.spec.ts +++ b/test/e2e/schedulers/unstaked.spec.ts @@ -24,24 +24,6 @@ describe('Unstaked Scheduler (e2e)', () => { let app: INestApplication; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['SUBSTRATE_URL', process.env.SUBSTRATE_URL], - ['ELASTICSEARCH_USERNAME', process.env.ELASTICSEARCH_USERNAME], - ['ELASTICSEARCH_PASSWORD', process.env.ELASTICSEARCH_PASSWORD], - ['ADMIN_SUBSTRATE_MNEMONIC', process.env.ADMIN_SUBSTRATE_MNEMONIC], - ['UNSTAKE_TIMER', process.env.UNSTAKE_TIMER], - ['UNSTAKE_INTERVAL', process.env.UNSTAKE_INTERVAL], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - global.console = { ...console, log: jest.fn(), @@ -56,8 +38,7 @@ describe('Unstaked Scheduler (e2e)', () => { imports: [ ElasticsearchModule.registerAsync({ inject: [], - useFactory: async ( - ) => ({ + useFactory: async () => ({ node: process.env.ELASTICSEARCH_NODE, auth: { username: config.ELASTICSEARCH_USERNAME.toString(), @@ -69,8 +50,7 @@ describe('Unstaked Scheduler (e2e)', () => { SubstrateModule, ScheduleModule.forRoot(), ], - }) - .compile(); + }).compile(); schedulerRegistry = module.get(SchedulerRegistry); substrateService = module.get(SubstrateService); diff --git a/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts index 3b9a0edd..e574dfc9 100644 --- a/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler.spec.ts @@ -28,23 +28,6 @@ describe('Genetic Analysis Order Paid Handler Event', () => { let notificationServiceMock: MockType; let proceccEnvProxy: MockType; // eslint-disable-line - const GA_ORDER_LINK = 'http://localhost/lab/orders/'; - const POSTGRES_HOST = 'localhost'; - - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['GA_ORDER_LINK', GA_ORDER_LINK], - ['POSTGRES_HOST', POSTGRES_HOST], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ providers: [ diff --git a/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts index 2350feb4..219d5541 100644 --- a/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler.spec.ts @@ -4,7 +4,7 @@ import { SubstrateService, TransactionLoggingService, } from '@common/index'; -import { Order, OrderStatus } from '@debionetwork/polkadot-provider'; +import { OrderStatus } from '@debionetwork/polkadot-provider'; import { OrderCreatedCommand } from '@listeners/substrate-listener/commands/orders'; import { Test, TestingModule } from '@nestjs/testing'; import { @@ -27,7 +27,6 @@ import { TransactionRequest } from '@common/transaction-logging/models/transacti import * as globalProviderMethods from '@debionetwork/polkadot-provider/lib/index'; import * as rewardCommand from '@debionetwork/polkadot-provider/lib/command/rewards'; -import * as serviceRequestCommand from '@debionetwork/polkadot-provider/lib/command/service-request'; import * as userProfileQuery from '@debionetwork/polkadot-provider/lib/query/user-profile'; import * as serviceRequestQuery from '@debionetwork/polkadot-provider/lib/query/service-request'; import * as ordersQuery from '@debionetwork/polkadot-provider/lib/query/labs/orders'; diff --git a/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts index ad155078..9293019f 100644 --- a/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/orders/order-paid/order-paid.handler.spec.ts @@ -31,23 +31,6 @@ describe('Order Paid Handler Event', () => { let transactionLoggingServiceMock: MockType; let proceccEnvProxy: MockType; // eslint-disable-line - const LAB_ORDER_LINK = 'http://localhost/lab/orders/'; - const POSTGRES_HOST = 'localhost'; - - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['LAB_ORDER_LINK', LAB_ORDER_LINK], - ['POSTGRES_HOST', POSTGRES_HOST], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeEach(async () => { jest .useFakeTimers() diff --git a/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts index 0c0a72bc..30f70ef4 100644 --- a/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/service-request/service-request-created/service-request-created.handler.spec.ts @@ -7,7 +7,6 @@ import { transactionLoggingServiceMockFactory, notificationServiceMockFactory, dateTimeProxyMockFactory, - googleSecretManagerServiceMockFactory, } from '../../../../../mock'; import { MailerManager, diff --git a/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts b/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts index 82492c3b..aa4817f9 100644 --- a/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/commands/services/service-created/service-created.handler.spec.ts @@ -9,7 +9,6 @@ import { ServiceFlow, ServiceInfo } from '@debionetwork/polkadot-provider'; import { ServiceCreatedHandler } from '@listeners/substrate-listener/commands/services/service-created/service-created.handler'; import { dateTimeProxyMockFactory, - googleSecretManagerServiceMockFactory, mailerManagerMockFactory, mockBlockNumber, MockType, diff --git a/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts b/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts index f5b79c06..919fdcde 100644 --- a/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts @@ -44,16 +44,6 @@ describe('Substrate Listener Handler Unit Test', () => { })); const NODE_ENV = 'development'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([['NODE_ENV', NODE_ENV]]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } class ProcessEnvProxyMock { env = { NODE_ENV, diff --git a/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts b/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts index 66285acd..87d0f843 100644 --- a/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts +++ b/test/unit/schedulers/genetic-analyst-unstaked/genetic-analyst-unstaked.service.spec.ts @@ -30,20 +30,6 @@ describe('UnstakedService', () => { const INTERVAL = '00:00:00:30'; const TIMER = '6:00:00:00'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - class ProcessEnvProxyMock { env = { UNSTAKE_INTERVAL: INTERVAL, diff --git a/test/unit/schedulers/lab/lab-unstake.service.spec.ts b/test/unit/schedulers/lab/lab-unstake.service.spec.ts index 9c5d5651..572b2b06 100644 --- a/test/unit/schedulers/lab/lab-unstake.service.spec.ts +++ b/test/unit/schedulers/lab/lab-unstake.service.spec.ts @@ -31,20 +31,6 @@ describe('LabUnstakedService', () => { const INTERVAL = '00:00:00:30'; const TIMER = '6:00:00:00'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - const createSearchObject = () => { return { index: 'labs', diff --git a/test/unit/schedulers/mailer/mailer.service.spec.ts b/test/unit/schedulers/mailer/mailer.service.spec.ts index 18ab4d79..3ece58ba 100644 --- a/test/unit/schedulers/mailer/mailer.service.spec.ts +++ b/test/unit/schedulers/mailer/mailer.service.spec.ts @@ -5,7 +5,6 @@ import { mailerManagerMockFactory, emailNotificationServiceMockFactory, substrateServiceMockFactory, - googleSecretManagerServiceMockFactory, } from '../../mock'; import { MailerService } from '@schedulers/mailer/mailer.service'; import { diff --git a/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts b/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts index e2170b29..6869282c 100644 --- a/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts +++ b/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts @@ -18,27 +18,6 @@ describe('Menstrual Subscription Service', () => { let substrateServiceMock: MockType; let schedulerRegistryMock: MockType; - const MENSTRUAL_SUBSCRIPTION_DURATION = - process?.env?.MENSTRUAL_SUBSCRIPTION_DURATION ?? - '{"Monthly": "30:00:00:00", "Quarterly": "90:00:00:00", "Yearly": "365:00:00:00"}'; - const INTERVAL = '00:00:00:30'; - const TIMER = '6:00:00:00'; - - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['MENSTRUAL_SUBSCRIPTION_DURATION', MENSTRUAL_SUBSCRIPTION_DURATION], - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ providers: [ diff --git a/test/unit/schedulers/unstaked/unstaked.service.spec.ts b/test/unit/schedulers/unstaked/unstaked.service.spec.ts index f66f885c..5f6cd03e 100644 --- a/test/unit/schedulers/unstaked/unstaked.service.spec.ts +++ b/test/unit/schedulers/unstaked/unstaked.service.spec.ts @@ -30,20 +30,6 @@ describe('UnstakedService', () => { const INTERVAL = '00:00:00:30'; const TIMER = '6:00:00:00'; - class GoogleSecretManagerServiceMock { - _secretsList = new Map([ - ['UNSTAKE_INTERVAL', INTERVAL], - ['UNSTAKE_TIMER', TIMER], - ]); - loadSecrets() { - return null; - } - - getSecret(key) { - return this._secretsList.get(key); - } - } - const createSearchObject = () => { return { index: 'create-service-request',