diff --git a/src/modules/connection-test/connection-test.controller.spec.ts b/src/modules/connection-test/connection-test.controller.spec.ts index efe3fe0..fa88dfe 100644 --- a/src/modules/connection-test/connection-test.controller.spec.ts +++ b/src/modules/connection-test/connection-test.controller.spec.ts @@ -1,12 +1,19 @@ import { Test, TestingModule } from '@nestjs/testing'; import { ConnectionTestController } from './connection-test.controller'; +import { ConnectionTestService } from './connection-test.service'; +import { DadosferaLogger } from 'dadosfera-logs'; +import { ConnectionTestClientConfiguration } from './connection-test-client.config'; +import { ClientsModule } from '@nestjs/microservices'; describe('ConnectionTestController', () => { let controller: ConnectionTestController; beforeEach(async () => { + const client = new ConnectionTestClientConfiguration(); const module: TestingModule = await Test.createTestingModule({ controllers: [ConnectionTestController], + providers: [ConnectionTestService, DadosferaLogger], + imports: [ClientsModule.register([client.providerOptions])], }).compile(); controller = module.get(ConnectionTestController); diff --git a/src/modules/connection-test/connection-test.service.spec.ts b/src/modules/connection-test/connection-test.service.spec.ts index 3b44f65..39c1448 100644 --- a/src/modules/connection-test/connection-test.service.spec.ts +++ b/src/modules/connection-test/connection-test.service.spec.ts @@ -1,12 +1,19 @@ import { Test, TestingModule } from '@nestjs/testing'; +import { ConnectionTestController } from './connection-test.controller'; import { ConnectionTestService } from './connection-test.service'; +import { DadosferaLogger } from 'dadosfera-logs'; +import { ConnectionTestClientConfiguration } from './connection-test-client.config'; +import { ClientsModule } from '@nestjs/microservices'; describe('ConnectionTestService', () => { let service: ConnectionTestService; beforeEach(async () => { + const client = new ConnectionTestClientConfiguration(); const module: TestingModule = await Test.createTestingModule({ - providers: [ConnectionTestService], + controllers: [ConnectionTestController], + providers: [ConnectionTestService, DadosferaLogger], + imports: [ClientsModule.register([client.providerOptions])], }).compile(); service = module.get(ConnectionTestService); diff --git a/src/modules/network-config/network-config.controller.spec.ts b/src/modules/network-config/network-config.controller.spec.ts index 84d229d..b54db8e 100644 --- a/src/modules/network-config/network-config.controller.spec.ts +++ b/src/modules/network-config/network-config.controller.spec.ts @@ -1,12 +1,19 @@ +import { ClientsModule } from '@nestjs/microservices'; import { Test, TestingModule } from '@nestjs/testing'; +import { NetworkConfigClientConfiguration } from './network-config-client.config'; import { NetworkConfigController } from './network-config.controller'; +import { NetworkConfigService } from './network-config.service'; +import { DadosferaLogger } from 'dadosfera-logs'; describe('NetworkConfigController', () => { let controller: NetworkConfigController; beforeEach(async () => { + const client = new NetworkConfigClientConfiguration(); const module: TestingModule = await Test.createTestingModule({ controllers: [NetworkConfigController], + providers: [NetworkConfigService, DadosferaLogger], + imports: [ClientsModule.register([client.providerOptions])], }).compile(); controller = module.get(NetworkConfigController); diff --git a/src/modules/network-config/network-config.service.spec.ts b/src/modules/network-config/network-config.service.spec.ts index 0311256..1d71b2b 100644 --- a/src/modules/network-config/network-config.service.spec.ts +++ b/src/modules/network-config/network-config.service.spec.ts @@ -1,12 +1,19 @@ +import { ClientsModule } from '@nestjs/microservices'; import { Test, TestingModule } from '@nestjs/testing'; +import { NetworkConfigClientConfiguration } from './network-config-client.config'; +import { NetworkConfigController } from './network-config.controller'; import { NetworkConfigService } from './network-config.service'; +import { DadosferaLogger } from 'dadosfera-logs'; describe('NetworkConfigService', () => { let service: NetworkConfigService; beforeEach(async () => { + const client = new NetworkConfigClientConfiguration(); const module: TestingModule = await Test.createTestingModule({ - providers: [NetworkConfigService], + controllers: [NetworkConfigController], + providers: [NetworkConfigService, DadosferaLogger], + imports: [ClientsModule.register([client.providerOptions])], }).compile(); service = module.get(NetworkConfigService);