diff --git a/test/e2e/indexer/events/certification-events.spec.ts b/test/e2e/indexer/events/certification-events.spec.ts index a7165aee..284b41f1 100644 --- a/test/e2e/indexer/events/certification-events.spec.ts +++ b/test/e2e/indexer/events/certification-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { Certification, createCertification, @@ -27,7 +23,6 @@ import { LabCommandHandlers } from '@indexer/events/labs'; import { initializeApi } from '../../polkadot-init'; import { labDataMock } from '../../../mock/models/labs/labs.mock'; import { certificationDataMock } from '../../../mock/models/certifications/certification-mock'; -import { SecretKeyList } from '@common/secrets'; describe('Certification Event', () => { let app: INestApplication; @@ -70,7 +65,6 @@ describe('Certification Event', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -83,8 +77,6 @@ describe('Certification Event', () => { ...CertificationsCommandHandlers, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/genetic-analysis-events.spec.ts b/test/e2e/indexer/events/genetic-analysis-events.spec.ts index 4b053679..78e7b5d2 100644 --- a/test/e2e/indexer/events/genetic-analysis-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analysis-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { addGeneticData, createGeneticAnalysisOrder, @@ -77,7 +73,6 @@ describe('Genetic Analysis Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -86,8 +81,6 @@ describe('Genetic Analysis Events', () => { ], providers: [IndexerHandler], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); 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 1272e77d..7daf04e4 100644 --- a/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analysis-order-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { addGeneticData, cancelGeneticAnalysisOrder, @@ -85,7 +81,6 @@ describe('Genetic Analysis Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -94,8 +89,6 @@ describe('Genetic Analysis Events', () => { ], providers: [IndexerHandler], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/genetic-analyst-events.spec.ts b/test/e2e/indexer/events/genetic-analyst-events.spec.ts index c6750dae..6d35867f 100644 --- a/test/e2e/indexer/events/genetic-analyst-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { deregisterGeneticAnalyst, GeneticAnalyst, @@ -72,7 +68,6 @@ describe('Genetic Analyst Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -81,8 +76,6 @@ describe('Genetic Analyst Events', () => { ], providers: [IndexerHandler, ...GeneticAnalystsCommandHandlers], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); 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 fdd489ac..c199f784 100644 --- a/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-qualification-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { createQualification, deleteQualification, @@ -64,7 +60,6 @@ describe('Genetic Analyst Qualification Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -73,8 +68,6 @@ describe('Genetic Analyst Qualification Events', () => { ], providers: [IndexerHandler], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); 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 fc8fe676..d17bd029 100644 --- a/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts +++ b/test/e2e/indexer/events/genetic-analyst-service-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { createGeneticAnalystService, deleteGeneticAnalystService, @@ -69,7 +65,6 @@ describe('Genetic Analyst Service Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -78,8 +73,6 @@ describe('Genetic Analyst Service Events', () => { ], providers: [IndexerHandler], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/genetic-data-events.spec.ts b/test/e2e/indexer/events/genetic-data-events.spec.ts index 741bda3c..ffd76c58 100644 --- a/test/e2e/indexer/events/genetic-data-events.spec.ts +++ b/test/e2e/indexer/events/genetic-data-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { addGeneticData, GeneticData, @@ -68,7 +64,6 @@ describe('Genetic Data Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -77,8 +72,6 @@ describe('Genetic Data Events', () => { ], providers: [IndexerHandler, ...GeneticDataCommandHandlers], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/genetic-testing-events.spec.ts b/test/e2e/indexer/events/genetic-testing-events.spec.ts index 8a079512..4c078605 100644 --- a/test/e2e/indexer/events/genetic-testing-events.spec.ts +++ b/test/e2e/indexer/events/genetic-testing-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { INestApplication } from '@nestjs/common'; import { CqrsModule } from '@nestjs/cqrs'; import { ElasticsearchService } from '@nestjs/elasticsearch'; @@ -35,7 +31,6 @@ import { import { labDataMock } from '../../../mock/models/labs/labs.mock'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { serviceDataMock } from '../../../mock/models/labs/services.mock'; -import { SecretKeyList } from '@common/secrets'; describe('Indexer Genetic Testing Event', () => { let app: INestApplication; @@ -56,33 +51,9 @@ describe('Indexer Genetic Testing 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: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), CommonModule, ProcessEnvModule, CqrsModule, @@ -91,8 +62,6 @@ describe('Indexer Genetic Testing Event', () => { ], providers: [IndexerHandler, ...GeneticTestingCommandHandlers], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/labs-events.spec.ts b/test/e2e/indexer/events/labs-events.spec.ts index 9654614f..0ba67098 100644 --- a/test/e2e/indexer/events/labs-events.spec.ts +++ b/test/e2e/indexer/events/labs-events.spec.ts @@ -20,10 +20,6 @@ import { ProcessEnvModule } from '@common/proxies/process-env/process-env.module import { IndexerHandler } from '@indexer/indexer.handler'; import { initializeApi } from '../../polkadot-init'; import { labDataMock } from '../../../mock/models/labs/labs.mock'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { IndexerModule } from '@indexer/indexer.module'; import { LabCommandHandlers } from '@indexer/events/labs'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; @@ -70,10 +66,6 @@ describe('Event Command Service Request Claimed', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), CommonModule, ProcessEnvModule, CqrsModule, @@ -82,8 +74,6 @@ describe('Event Command Service Request Claimed', () => { ], providers: [IndexerHandler, ...LabCommandHandlers], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/menstrual-calendar-events.spec.ts b/test/e2e/indexer/events/menstrual-calendar-events.spec.ts index d6e0a102..6d0328e6 100644 --- a/test/e2e/indexer/events/menstrual-calendar-events.spec.ts +++ b/test/e2e/indexer/events/menstrual-calendar-events.spec.ts @@ -3,10 +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 { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { SecretKeyList } from '@common/secrets'; import { CommonModule, ProcessEnvModule } from '@common/index'; import { CqrsModule } from '@nestjs/cqrs'; @@ -60,7 +56,6 @@ describe('Menstrual Calendar Test Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -69,8 +64,6 @@ describe('Menstrual Calendar Test Events', () => { ], providers: [IndexerHandler, ...MenstrualCalendarCommandHandlers], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/orders-events.spec.ts b/test/e2e/indexer/events/orders-events.spec.ts index 0f0d4904..6ecc810a 100644 --- a/test/e2e/indexer/events/orders-events.spec.ts +++ b/test/e2e/indexer/events/orders-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { INestApplication } from '@nestjs/common'; import { CqrsModule } from '@nestjs/cqrs'; import { ElasticsearchService } from '@nestjs/elasticsearch'; @@ -74,7 +70,6 @@ describe('Orders Events', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -83,8 +78,6 @@ describe('Orders Events', () => { ], providers: [IndexerHandler, ...OrderCommandHandlers], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/service-events.spec.ts b/test/e2e/indexer/events/service-events.spec.ts index 64b9c552..0a5ab712 100644 --- a/test/e2e/indexer/events/service-events.spec.ts +++ b/test/e2e/indexer/events/service-events.spec.ts @@ -1,7 +1,3 @@ -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { createService, deleteService, @@ -68,7 +64,6 @@ describe('Service Event', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig(process.env.PARENT, SecretKeyList), CommonModule, ProcessEnvModule, CqrsModule, @@ -81,8 +76,6 @@ describe('Service Event', () => { ...ServiceCommandHandlers, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = diff --git a/test/e2e/indexer/events/service-request-events.spec.ts b/test/e2e/indexer/events/service-request-events.spec.ts index 236fe284..7b48822e 100644 --- a/test/e2e/indexer/events/service-request-events.spec.ts +++ b/test/e2e/indexer/events/service-request-events.spec.ts @@ -34,11 +34,6 @@ import { RequestServiceCommandHandlers } from '@indexer/events/service-request'; import { ScheduleModule } from '@nestjs/schedule'; import { IndexerModule } from '@indexer/indexer.module'; import { serviceRequestMock } from '../../../mock/models/service-request/service-request.mock'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList } from '@common/secrets'; describe('Event Command Service Request Claimed', () => { let app: INestApplication; @@ -82,10 +77,6 @@ describe('Event Command Service Request Claimed', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), CommonModule, ProcessEnvModule, CqrsModule, @@ -99,8 +90,6 @@ describe('Event Command Service Request Claimed', () => { ...RequestServiceCommandHandlers, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); elasticsearchService = 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 3cba9222..2d09340c 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 @@ -58,17 +58,13 @@ import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitiv import { geneticAnalystServiceDataMock } from '../../../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { GeneticAnalysisOrderCreatedHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysys-order-created/genetic-analysis-order-created.handler'; import { GeneticAnalysisOrderFulfilledHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-fulfilled/genetic-analysis-order-fulfilled.handler'; import { GeneticAnalysisOrderPaidHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler'; -import { keyList, SecretKeyList } from '@common/secrets'; 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'; describe('Genetic Analysis Order Created Integration Test', () => { let app: INestApplication; @@ -108,10 +104,6 @@ describe('Genetic Analysis Order Created Integration Test', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -127,14 +119,9 @@ describe('Genetic Analysis Order Created Integration Test', () => { NotificationModule, MailerModule.forRootAsync({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.PARENT, - SecretKeyList, - ), ], - inject: [GCloudSecretManagerService], + inject: [], useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, ) => { return { transport: { @@ -142,9 +129,7 @@ describe('Genetic Analysis Order Created Integration Test', () => { secure: false, auth: { user: process.env.EMAIL, - pass: gCloudSecretManagerService - .getSecret('PASS_EMAIL') - .toString(), + pass: config.PASS_EMAIL.toString(), }, }, template: { @@ -175,8 +160,6 @@ describe('Genetic Analysis Order Created Integration Test', () => { GeneticAnalysisOrderPaidHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 6dbfe09f..f359d7bc 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 @@ -51,12 +51,7 @@ import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitiv import { geneticAnalystServiceDataMock } from '../../../../../mock/models/genetic-analysts/genetic-analyst-service.mock'; import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { GeneticAnalysisRejectedHandler } from '@listeners/substrate-listener/commands/genetic-analysis/genetic-analysis-rejected/genetic-analysis-rejected.handler'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analysis Order Created Integration Test', () => { let app: INestApplication; @@ -96,10 +91,6 @@ describe('Genetic Analysis Order Created Integration Test', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -129,8 +120,6 @@ describe('Genetic Analysis Order Created Integration Test', () => { GeneticAnalysisRejectedHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 5f0b582c..4e1b5812 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 @@ -39,11 +39,6 @@ import { geneticAnalystServiceDataMock } from '../../../../../mock/models/geneti import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; import { GeneticAnalystServiceCommandHandler } from '@listeners/substrate-listener/commands/genetic-analyst-services'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList } from '@common/secrets'; describe('Genetic Analyst Service Created Event', () => { let app: INestApplication; @@ -83,10 +78,6 @@ describe('Genetic Analyst Service Created Event', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -109,8 +100,6 @@ describe('Genetic Analyst Service Created Event', () => { ...GeneticAnalystServiceCommandHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 b82d473f..70703956 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 @@ -30,12 +30,7 @@ import { geneticAnalystsDataMock } from '../../../../../mock/models/genetic-anal import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { GeneticAnalystRegisteredHandler } from '@listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-registered/genetic-analyst-registered.handler'; -import { SecretKeyList } from '@common/secrets'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; import { GeneticAnalystVerificationStatusHandler } from '@listeners/substrate-listener/commands/genetic-analysts/genetic-analyst-verification-status/genetic-analyst-verification-status.handler'; @@ -77,10 +72,6 @@ describe('Genetic analyst verification status', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -105,8 +96,6 @@ describe('Genetic analyst verification status', () => { GeneticAnalystVerificationStatusHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 0d9963a4..2a542925 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 @@ -58,10 +58,6 @@ import { CqrsModule } from '@nestjs/cqrs'; import { SubstrateListenerHandler } from '@listeners/substrate-listener/substrate-listener.handler'; import { createConnection } from 'typeorm'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; 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'; @@ -110,10 +106,6 @@ describe('Data Staked Integration Tests', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -140,8 +132,6 @@ describe('Data Staked Integration Tests', () => { DnaSampleResultReadyCommandHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 e4710cf4..275700e6 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 @@ -31,12 +31,7 @@ import { CqrsModule } from '@nestjs/cqrs'; import { SubstrateListenerHandler } from '@listeners/substrate-listener/substrate-listener.handler'; import { LabStakeSuccessfullHandler } from '@listeners/substrate-listener/commands/labs/stake-successfull/stake-successful.handler'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { SecretKeyList } from '@common/secrets'; import { labUnstakedHandler } from '@listeners/substrate-listener/commands/labs/unstake-successfull/unstaked-successful.handler'; import { LabUpdateVerificationStatusHandler } from '@listeners/substrate-listener/commands/labs/update-verification-status/update-verification-status.handler'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; @@ -78,10 +73,6 @@ describe('lab staking Integration Tests', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -107,8 +98,6 @@ describe('lab staking Integration Tests', () => { LabUpdateVerificationStatusHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 f19e4950..85e98054 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 @@ -58,18 +58,14 @@ import { SubstrateListenerHandler } from '@listeners/substrate-listener/substrat import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; import { DnaSample } from '@debionetwork/polkadot-provider/lib/models/labs/genetic-testing/dna-sample'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { OrderFailedHandler } from '@listeners/substrate-listener/commands/orders/order-failed/order-failed.handler'; -import { keyList, SecretKeyList } from '@common/secrets'; import { deleteService, deregisterLab } from '@debionetwork/polkadot-provider'; import { OrderFulfilledHandler } from '@listeners/substrate-listener/commands/orders/order-fulfilled/order-fulfilled.handler'; import { OrderPaidHandler } from '@listeners/substrate-listener/commands/orders/order-paid/order-paid.handler'; import { MailerModule } from '@nestjs-modules/mailer'; import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; import { join } from 'path'; +import { config } from '../../../../../../src/config'; describe('Order Failed Integration Tests', () => { let app: INestApplication; @@ -111,10 +107,6 @@ describe('Order Failed Integration Tests', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -131,18 +123,13 @@ describe('Order Failed Integration Tests', () => { DebioConversionModule, MailerModule.forRootAsync({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.PARENT, - SecretKeyList, - ), ], - inject: [GCloudSecretManagerService], + inject: [], useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, ) => { console.log( - gCloudSecretManagerService.getSecret('EMAIL').toString(), - gCloudSecretManagerService.getSecret('PASS_EMAIL').toString(), + config.EMAIL.toString(), + config.PASS_EMAIL.toString(), ); return { transport: { @@ -150,12 +137,8 @@ describe('Order Failed Integration Tests', () => { port: 587, secure: false, auth: { - user: gCloudSecretManagerService - .getSecret('EMAIL') - .toString(), - pass: gCloudSecretManagerService - .getSecret('PASS_EMAIL') - .toString(), + user: config.EMAIL.toString(), + pass: config.PASS_EMAIL.toString(), }, }, template: { @@ -186,8 +169,6 @@ describe('Order Failed Integration Tests', () => { OrderPaidHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 569fa38b..4ad5de63 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 @@ -48,12 +48,7 @@ import { serviceRequestMock } from '../../../../../mock/models/labs/service-requ import { createConnection } from 'typeorm'; import { Notification } from '@common/notification/models/notification.entity'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { ServiceRequestStakingAmountExcessRefunded } from '@listeners/substrate-listener/commands/service-request/service-request-excess/service-request-excess.handler'; -import { SecretKeyList } from '@common/secrets'; import { ServiceRequestStakingAmountRefundedHandler } from '@listeners/substrate-listener/commands/service-request/service-request-staking-amount-refunded/service-request-staking-amount-refunded.handler'; describe('Service Request Excess Integration Tests', () => { @@ -94,10 +89,6 @@ describe('Service Request Excess Integration Tests', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -123,8 +114,6 @@ describe('Service Request Excess Integration Tests', () => { ServiceRequestStakingAmountRefundedHandler, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = module.createNestApplication(); 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 b6d42535..bf7168e9 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 @@ -32,12 +32,7 @@ import { labDataMock } from '../../../../../mock/models/labs/labs.mock'; import { serviceDataMock } from '../../../../../mock/models/labs/services.mock'; import { Notification } from '@common/notification/models/notification.entity'; import { createConnection } from 'typeorm'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { VerificationStatus } from '@debionetwork/polkadot-provider/lib/primitives/verification-status'; -import { SecretKeyList } from '@common/secrets'; describe('Service Created Integration Tests', () => { let app: INestApplication; @@ -81,10 +76,6 @@ describe('Service Created Integration Tests', () => { beforeAll(async () => { const modules: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), TypeOrmModule.forRoot({ type: 'postgres', ...dummyCredentials, @@ -109,8 +100,6 @@ describe('Service Created Integration Tests', () => { ...ServiceCommandHandlers, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); app = modules.createNestApplication(); diff --git a/test/e2e/schedulers/lab-unstake.spec.ts b/test/e2e/schedulers/lab-unstake.spec.ts index f29eaa4c..073f139b 100644 --- a/test/e2e/schedulers/lab-unstake.spec.ts +++ b/test/e2e/schedulers/lab-unstake.spec.ts @@ -15,17 +15,12 @@ import { LabUnstakedService } from '@schedulers/lab-unstake/lab-unstake.service' import * as labQuery from '@debionetwork/polkadot-provider/lib/query/labs'; import { Lab } from '@debionetwork/polkadot-provider'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../../src/config'; describe('Lab Unstaked Scheduler (e2e)', () => { let schedulerRegistry: SchedulerRegistry; let labUnstakedService: LabUnstakedService; let substrateService: SubstrateService; - let gCloudSecretManagerService: GCloudSecretManagerService; let elasticsearchService: ElasticsearchService; let app: INestApplication; @@ -60,23 +55,14 @@ describe('Lab Unstaked Scheduler (e2e)', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), ElasticsearchModule.registerAsync({ - inject: [GCloudSecretManagerService], + inject: [], useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, ) => ({ node: process.env.ELASTICSEARCH_NODE, auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }), }), @@ -85,17 +71,13 @@ describe('Lab Unstaked Scheduler (e2e)', () => { ScheduleModule.forRoot(), ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); schedulerRegistry = module.get(SchedulerRegistry); substrateService = module.get(SubstrateService); - gCloudSecretManagerService = module.get(GCloudSecretManagerService); elasticsearchService = module.get(ElasticsearchService); labUnstakedService = new LabUnstakedService( - gCloudSecretManagerService, elasticsearchService, substrateService, schedulerRegistry, diff --git a/test/e2e/schedulers/mailer.spec.ts b/test/e2e/schedulers/mailer.spec.ts index f566dcec..ce846b59 100644 --- a/test/e2e/schedulers/mailer.spec.ts +++ b/test/e2e/schedulers/mailer.spec.ts @@ -17,19 +17,14 @@ import { Keyring } from '@polkadot/api'; import { TypeOrmModule } from '@nestjs/typeorm'; import { dummyCredentials } from '../config'; import { SubstrateService } from '@common/substrate/substrate.service'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; import { ElasticsearchModule } from '@nestjs/elasticsearch'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../../src/config'; describe('Mailer Scheduler (e2e)', () => { let service: MailerService; let mailerManager: MailerManager; let substrateService: SubstrateService; let emailNotificationService: EmailNotificationService; - let gCloudSecretManagerService: GCloudSecretManagerService; let app: INestApplication; @@ -73,23 +68,14 @@ describe('Mailer Scheduler (e2e)', () => { const module: TestingModule = await Test.createTestingModule({ imports: [ ProcessEnvModule, - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), ElasticsearchModule.registerAsync({ - inject: [GCloudSecretManagerService], + inject: [], useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, ) => ({ node: process.env.ELASTICSEARCH_NODE, auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }), }), @@ -105,17 +91,13 @@ describe('Mailer Scheduler (e2e)', () => { EmailNotificationModule, ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); mailerManager = module.get(MailerManager); substrateService = module.get(SubstrateService); emailNotificationService = module.get(EmailNotificationService); - gCloudSecretManagerService = module.get(GCloudSecretManagerService); service = new MailerService( - gCloudSecretManagerService, mailerManager, emailNotificationService, substrateService, diff --git a/test/e2e/schedulers/unstaked.spec.ts b/test/e2e/schedulers/unstaked.spec.ts index 096ca4d8..b65ff494 100644 --- a/test/e2e/schedulers/unstaked.spec.ts +++ b/test/e2e/schedulers/unstaked.spec.ts @@ -14,17 +14,12 @@ import { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule'; import { UnstakedService } from '@schedulers/unstaked/unstaked.service'; import * as serviceRequestQuery from '@debionetwork/polkadot-provider/lib/query/service-request'; import { ServiceRequest } from '@debionetwork/polkadot-provider'; -import { - GCloudSecretManagerModule, - GCloudSecretManagerService, -} from '@debionetwork/nestjs-gcloud-secret-manager'; -import { SecretKeyList, keyList } from '@common/secrets'; +import { config } from '../../../src/config'; describe('Unstaked Scheduler (e2e)', () => { let schedulerRegistry: SchedulerRegistry; let unstakedService: UnstakedService; let substrateService: SubstrateService; - let gCloudSecretManagerService: GCloudSecretManagerService; let elasticsearchService: ElasticsearchService; let app: INestApplication; @@ -59,23 +54,14 @@ describe('Unstaked Scheduler (e2e)', () => { beforeAll(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ - GCloudSecretManagerModule.withConfig( - process.env.GCS_PARENT, - SecretKeyList, - ), ElasticsearchModule.registerAsync({ - inject: [GCloudSecretManagerService], + inject: [], useFactory: async ( - gCloudSecretManagerService: GCloudSecretManagerService, ) => ({ node: process.env.ELASTICSEARCH_NODE, auth: { - username: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_USERNAME') - .toString(), - password: gCloudSecretManagerService - .getSecret('ELASTICSEARCH_PASSWORD') - .toString(), + username: config.ELASTICSEARCH_USERNAME.toString(), + password: config.ELASTICSEARCH_PASSWORD.toString(), }, }), }), @@ -84,17 +70,13 @@ describe('Unstaked Scheduler (e2e)', () => { ScheduleModule.forRoot(), ], }) - .overrideProvider(GCloudSecretManagerService) - .useClass(GoogleSecretManagerServiceMock) .compile(); schedulerRegistry = module.get(SchedulerRegistry); substrateService = module.get(SubstrateService); - gCloudSecretManagerService = module.get(GCloudSecretManagerService); elasticsearchService = module.get(ElasticsearchService); unstakedService = new UnstakedService( - gCloudSecretManagerService, elasticsearchService, substrateService, schedulerRegistry, 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 18eed7f7..3b9a0edd 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 @@ -21,7 +21,6 @@ import { import { GeneticAnalysisOrderPaidHandler } from '@listeners/substrate-listener/commands/genetic-analysis-order/genetic-analysis-order-paid/genetic-analysis-order-paid.handler'; import { when } from 'jest-when'; import { NotificationService } from '@common/notification/notification.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('Genetic Analysis Order Paid Handler Event', () => { let geneticAnalysisOrderPaidHandler: GeneticAnalysisOrderPaidHandler; @@ -69,10 +68,6 @@ describe('Genetic Analysis Order Paid Handler Event', () => { provide: SubstrateService, useFactory: substrateServiceMockFactory, }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, GeneticAnalysisOrderPaidHandler, ], }).compile(); 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 e6859b63..ad155078 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 @@ -23,7 +23,6 @@ import { when } from 'jest-when'; import { TransactionLoggingDto } from '@common/transaction-logging/dto/transaction-logging.dto'; import { TransactionRequest } from '@common/transaction-logging/models/transaction-request.entity'; import { NotificationService } from '@common/notification/notification.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { TransactionTypeList } from '@common/transaction-type/models/transaction-type.list'; import { TransactionStatusList } from '@common/transaction-status/models/transaction-status.list'; @@ -75,10 +74,6 @@ describe('Order Paid Handler Event', () => { provide: SubstrateService, useFactory: substrateServiceMockFactory, }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, OrderPaidHandler, ], }).compile(); 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 b5cfb380..0c0a72bc 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 @@ -23,7 +23,6 @@ import { NotificationService } from '@common/notification/notification.service'; import { BlockMetaData } from '@listeners/substrate-listener/models/block-metadata.event-model'; import { ServiceRequestCreatedCommand } from '@listeners/substrate-listener/commands/service-request'; import { when } from 'jest-when'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('Service Request Created Handler Event', () => { let serviceRequesCreatedHandler: ServiceRequestCreatedHandler; @@ -97,10 +96,6 @@ describe('Service Request Created Handler Event', () => { provide: DateTimeProxy, useFactory: dateTimeProxyMockFactory, }, - { - provide: GCloudSecretManagerService, - useFactory: googleSecretManagerServiceMockFactory, - }, ServiceRequestCreatedHandler, ], }).compile(); 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 bef84be6..82492c3b 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 @@ -20,7 +20,6 @@ import * as labQuery from '@debionetwork/polkadot-provider/lib/query/labs'; import { when } from 'jest-when'; import { NotificationService } from '@common/notification/notification.service'; import { ServiceCreatedCommand } from '@listeners/substrate-listener/commands/services'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('Service Created Handler Event', () => { let serviceCreatedHandle: ServiceCreatedHandler; @@ -72,10 +71,6 @@ describe('Service Created Handler Event', () => { provide: DateTimeProxy, useFactory: dateTimeProxyMockFactory, }, - { - provide: GCloudSecretManagerService, - useFactory: googleSecretManagerServiceMockFactory, - }, ServiceCreatedHandler, ], }).compile(); 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 eb203b52..f5b79c06 100644 --- a/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts +++ b/test/unit/listeners/substrate-listener/substrate-listener.handler.spec.ts @@ -18,7 +18,6 @@ import { } from './substrate-listener.mock.data'; import { Logger } from '@nestjs/common'; import { BlockMetaData } from '@listeners/substrate-listener/models/block-metadata.event-model'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; const eventsSpy = jest.spyOn(API_MOCK.query.system, 'events'); const getBlockSpy = jest.spyOn(API_MOCK.rpc.chain, 'getBlock'); @@ -69,10 +68,6 @@ describe('Substrate Listener Handler Unit Test', () => { { provide: QueryBus, useFactory: queryBusMockFactory }, { provide: CommandBus, useFactory: commandBusMockFactory }, { provide: ProcessEnvProxy, useClass: ProcessEnvProxyMock }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, ], }).compile(); diff --git a/test/unit/mock.ts b/test/unit/mock.ts index def6bfd9..2eaae925 100644 --- a/test/unit/mock.ts +++ b/test/unit/mock.ts @@ -25,7 +25,6 @@ import { CountryService } from '@common/location/country.service'; import { StateService } from '@common/location/state.service'; import { SchedulerRegistry } from '@nestjs/schedule'; import { NotificationService } from '@common/notification/notification.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { ErrorLoggingService } from '@common/error-logging/error-logging.service'; export function mockFunction(args) {} // eslint-disable-line @@ -366,13 +365,6 @@ export const schedulerRegistryMockFactory: () => MockType = addInterval: jest.fn(), })); -export const googleSecretManagerServiceMockFactory: () => MockType< - GCloudSecretManagerService -> = jest.fn(() => ({ - loadSecrets: jest.fn((entity) => entity), - getSecret: jest.fn((entity) => entity), -})); - export const errorLoggingServiceMockFactory: () => MockType = jest.fn(() => ({ getAllByToId: jest.fn((entity) => entity), 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 c04bfb35..66285acd 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 @@ -15,7 +15,6 @@ import * as geneticAnalystCommand from '@debionetwork/polkadot-provider/lib/comm import { when } from 'jest-when'; import { SchedulerRegistry } from '@nestjs/schedule'; import { GeneticAnalystUnstakedService } from '@schedulers/genetic-analyst-unstaked/unstaked.service'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import * as schedulersTools from '@common/tools/schedulers'; jest.useFakeTimers(); @@ -86,10 +85,6 @@ describe('UnstakedService', () => { provide: ProcessEnvProxy, useClass: ProcessEnvProxyMock, }, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory, diff --git a/test/unit/schedulers/lab/lab-unstake.service.spec.ts b/test/unit/schedulers/lab/lab-unstake.service.spec.ts index 472b253e..9c5d5651 100644 --- a/test/unit/schedulers/lab/lab-unstake.service.spec.ts +++ b/test/unit/schedulers/lab/lab-unstake.service.spec.ts @@ -16,7 +16,6 @@ import * as labQuery from '@debionetwork/polkadot-provider/lib/query/labs'; import * as labCommand from '@debionetwork/polkadot-provider/lib/command/labs'; import { when } from 'jest-when'; import { StakeStatus } from '@debionetwork/polkadot-provider/lib/primitives/stake-status'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import * as schedulersTools from '@common/tools/schedulers'; jest.useFakeTimers(); @@ -76,10 +75,6 @@ describe('LabUnstakedService', () => { const module: TestingModule = await Test.createTestingModule({ providers: [ LabUnstakedService, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory, diff --git a/test/unit/schedulers/mailer/mailer.service.spec.ts b/test/unit/schedulers/mailer/mailer.service.spec.ts index c1667346..18ab4d79 100644 --- a/test/unit/schedulers/mailer/mailer.service.spec.ts +++ b/test/unit/schedulers/mailer/mailer.service.spec.ts @@ -13,7 +13,6 @@ import { MailerManager, SubstrateService, } from '@common/index'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; describe('MailerService', () => { let mailManagerMock: MockType; @@ -36,10 +35,6 @@ describe('MailerService', () => { provide: SubstrateService, useFactory: substrateServiceMockFactory, }, - { - provide: GCloudSecretManagerService, - useFactory: googleSecretManagerServiceMockFactory, - }, ], }).compile(); module.useLogger(MockLogger); 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 cfc0dd51..e2170b29 100644 --- a/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts +++ b/test/unit/schedulers/menstrual-subscription/menstrual-subscription.service.spec.ts @@ -1,5 +1,4 @@ import { SubstrateService } from '@common/substrate'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import { ElasticsearchService } from '@nestjs/elasticsearch'; import { SchedulerRegistry } from '@nestjs/schedule'; import { Test, TestingModule } from '@nestjs/testing'; @@ -44,10 +43,6 @@ describe('Menstrual Subscription Service', () => { const module: TestingModule = await Test.createTestingModule({ providers: [ MenstrualSubscriptionService, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory, diff --git a/test/unit/schedulers/unstaked/unstaked.service.spec.ts b/test/unit/schedulers/unstaked/unstaked.service.spec.ts index 62208e0f..f66f885c 100644 --- a/test/unit/schedulers/unstaked/unstaked.service.spec.ts +++ b/test/unit/schedulers/unstaked/unstaked.service.spec.ts @@ -15,7 +15,6 @@ import * as serviceRequestQuery from '@debionetwork/polkadot-provider/lib/query/ import * as serviceRequestCommand from '@debionetwork/polkadot-provider/lib/command/service-request'; import { when } from 'jest-when'; import { SchedulerRegistry } from '@nestjs/schedule'; -import { GCloudSecretManagerService } from '@debionetwork/nestjs-gcloud-secret-manager'; import * as schedulersTools from '@common/tools/schedulers'; jest.useFakeTimers(); @@ -75,10 +74,6 @@ describe('UnstakedService', () => { const module: TestingModule = await Test.createTestingModule({ providers: [ UnstakedService, - { - provide: GCloudSecretManagerService, - useClass: GoogleSecretManagerServiceMock, - }, { provide: ElasticsearchService, useFactory: elasticsearchServiceMockFactory,