From 162433030f957f107782e78006e67631c3de09de Mon Sep 17 00:00:00 2001 From: tuttodev Date: Mon, 7 Nov 2022 07:10:12 -0500 Subject: [PATCH] fix: rename folders --- .../infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts | 4 ++-- .../infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts | 4 ++-- .../{RabbitMq => RabbitMQ}/ConnectionSettings.ts | 0 .../EventBus/{RabbitMq => RabbitMQ}/ExchangeSetting.ts | 0 .../{RabbitMq => RabbitMQ}/RabbitMQConfigurer.ts | 4 ++-- .../RabbitMQConnection.ts} | 2 +- .../{RabbitMq => RabbitMQ}/RabbitMQConsumer.ts | 6 +++--- .../{RabbitMq => RabbitMQ}/RabbitMQConsumerFactory.ts | 4 ++-- .../RabbitMQEventBus.ts} | 6 +++--- .../RabbitMQExchangeNameFormatter.ts | 0 .../{RabbitMq => RabbitMQ}/RabbitMQqueueFormatter.ts | 0 src/apps/backoffice/backend/BackofficeBackendApp.ts | 10 +++++----- .../backend/command/ConfigureRabbitMQCommand.ts | 4 ++-- .../dependency-injection/Shared/application.yaml | 2 +- src/apps/backoffice/backend/routes/courses.route.ts | 3 ++- src/apps/mooc/backend/MoocBackendApp.ts | 10 +++++----- .../mooc/backend/command/ConfigureRabbitMQCommand.ts | 4 ++-- .../dependency-injection/Shared/application.yaml | 2 +- .../infrastructure/EventBus/RabbitMQEventBus.test.ts | 4 ++-- .../EventBus/__mocks__/RabbitMQConnectionDouble.ts | 4 ++-- .../EventBus/__mother__/RabbitMQConnectionMother.ts | 4 ++-- 21 files changed, 39 insertions(+), 38 deletions(-) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq => RabbitMQ}/ConnectionSettings.ts (100%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq => RabbitMQ}/ExchangeSetting.ts (100%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq => RabbitMQ}/RabbitMQConfigurer.ts (95%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq/RabbitMqConnection.ts => RabbitMQ/RabbitMQConnection.ts} (99%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq => RabbitMQ}/RabbitMQConsumer.ts (93%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq => RabbitMQ}/RabbitMQConsumerFactory.ts (87%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq/RabbitMqEventBus.ts => RabbitMQ/RabbitMQEventBus.ts} (95%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq => RabbitMQ}/RabbitMQExchangeNameFormatter.ts (100%) rename src/Contexts/Shared/infrastructure/EventBus/{RabbitMq => RabbitMQ}/RabbitMQqueueFormatter.ts (100%) diff --git a/src/Contexts/Backoffice/Courses/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts b/src/Contexts/Backoffice/Courses/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts index 16b5afe..c7e9114 100644 --- a/src/Contexts/Backoffice/Courses/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts +++ b/src/Contexts/Backoffice/Courses/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts @@ -1,5 +1,5 @@ import { DomainEventFailoverPublisher } from '../../../../Shared/infrastructure/EventBus/DomainEventFailoverPublisher/DomainEventFailoverPublisher'; -import { RabbitMqConnection } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; import { RabbitMQEventBus } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMQEventBus'; import { RabbitMQqueueFormatter } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMQqueueFormatter'; import { RabbitMQConfig } from './RabbitMQConfigFactory'; @@ -7,7 +7,7 @@ import { RabbitMQConfig } from './RabbitMQConfigFactory'; export class RabbitMQEventBusFactory { static create( failoverPublisher: DomainEventFailoverPublisher, - connection: RabbitMqConnection, + connection: RabbitMQConnection, queueNameFormatter: RabbitMQqueueFormatter, config: RabbitMQConfig ): RabbitMQEventBus { diff --git a/src/Contexts/Mooc/Shared/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts b/src/Contexts/Mooc/Shared/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts index 16b5afe..c7e9114 100644 --- a/src/Contexts/Mooc/Shared/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts +++ b/src/Contexts/Mooc/Shared/infrastructure/RabbitMQ/RabbitMQEventBusFactory.ts @@ -1,5 +1,5 @@ import { DomainEventFailoverPublisher } from '../../../../Shared/infrastructure/EventBus/DomainEventFailoverPublisher/DomainEventFailoverPublisher'; -import { RabbitMqConnection } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; import { RabbitMQEventBus } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMQEventBus'; import { RabbitMQqueueFormatter } from '../../../../Shared/infrastructure/EventBus/RabbitMQ/RabbitMQqueueFormatter'; import { RabbitMQConfig } from './RabbitMQConfigFactory'; @@ -7,7 +7,7 @@ import { RabbitMQConfig } from './RabbitMQConfigFactory'; export class RabbitMQEventBusFactory { static create( failoverPublisher: DomainEventFailoverPublisher, - connection: RabbitMqConnection, + connection: RabbitMQConnection, queueNameFormatter: RabbitMQqueueFormatter, config: RabbitMQConfig ): RabbitMQEventBus { diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/ConnectionSettings.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/ConnectionSettings.ts similarity index 100% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/ConnectionSettings.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/ConnectionSettings.ts diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/ExchangeSetting.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/ExchangeSetting.ts similarity index 100% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/ExchangeSetting.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/ExchangeSetting.ts diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConfigurer.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConfigurer.ts similarity index 95% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConfigurer.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConfigurer.ts index c1eb993..674f80d 100644 --- a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConfigurer.ts +++ b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConfigurer.ts @@ -1,12 +1,12 @@ import { DomainEvent } from '../../../domain/DomainEvent'; import { DomainEventSubscriber } from '../../../domain/DomainEventSubscriber'; -import { RabbitMqConnection } from './RabbitMqConnection'; +import { RabbitMQConnection } from './RabbitMQConnection'; import { RabbitMQExchangeNameFormatter } from './RabbitMQExchangeNameFormatter'; import { RabbitMQqueueFormatter } from './RabbitMQqueueFormatter'; export class RabbitMQConfigurer { constructor( - private connection: RabbitMqConnection, + private connection: RabbitMQConnection, private queueNameFormatter: RabbitMQqueueFormatter, private messageRetryTtl: number ) {} diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMqConnection.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection.ts similarity index 99% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMqConnection.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection.ts index f7a5d86..7a693c1 100644 --- a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMqConnection.ts +++ b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection.ts @@ -2,7 +2,7 @@ import amqplib, { ConsumeMessage } from 'amqplib'; import { ConnectionSettings } from './ConnectionSettings'; import { RabbitMQExchangeNameFormatter } from './RabbitMQExchangeNameFormatter'; -export class RabbitMqConnection { +export class RabbitMQConnection { private connectionSettings: ConnectionSettings; private channel?: amqplib.ConfirmChannel; private connection?: amqplib.Connection; diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConsumer.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConsumer.ts similarity index 93% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConsumer.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConsumer.ts index ed813bf..0b74b19 100644 --- a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConsumer.ts +++ b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConsumer.ts @@ -2,12 +2,12 @@ import { ConsumeMessage } from 'amqplib'; import { DomainEvent } from '../../../domain/DomainEvent'; import { DomainEventSubscriber } from '../../../domain/DomainEventSubscriber'; import { DomainEventDeserializer } from '../DomainEventDeserializer'; -import { RabbitMqConnection } from './RabbitMqConnection'; +import { RabbitMQConnection } from './RabbitMQConnection'; export class RabbitMQConsumer { private subscriber: DomainEventSubscriber; private deserializer: DomainEventDeserializer; - private connection: RabbitMqConnection; + private connection: RabbitMQConnection; private maxRetries: Number; private queueName: string; private exchange: string; @@ -15,7 +15,7 @@ export class RabbitMQConsumer { constructor(params: { subscriber: DomainEventSubscriber; deserializer: DomainEventDeserializer; - connection: RabbitMqConnection; + connection: RabbitMQConnection; queueName: string; exchange: string; maxRetries: Number; diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConsumerFactory.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConsumerFactory.ts similarity index 87% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConsumerFactory.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConsumerFactory.ts index 1a7bdc1..b9b10bb 100644 --- a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQConsumerFactory.ts +++ b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConsumerFactory.ts @@ -1,13 +1,13 @@ import { DomainEvent } from '../../../domain/DomainEvent'; import { DomainEventSubscriber } from '../../../domain/DomainEventSubscriber'; import { DomainEventDeserializer } from '../DomainEventDeserializer'; -import { RabbitMqConnection } from './RabbitMqConnection'; +import { RabbitMQConnection } from './RabbitMQConnection'; import { RabbitMQConsumer } from './RabbitMQConsumer'; export class RabbitMQConsumerFactory { constructor( private deserializer: DomainEventDeserializer, - private connection: RabbitMqConnection, + private connection: RabbitMQConnection, private maxRetries: Number ) {} diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMqEventBus.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQEventBus.ts similarity index 95% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMqEventBus.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQEventBus.ts index 744e176..1e997e9 100644 --- a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMqEventBus.ts +++ b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQEventBus.ts @@ -4,20 +4,20 @@ import { DomainEventDeserializer } from '../DomainEventDeserializer'; import { DomainEventFailoverPublisher } from '../DomainEventFailoverPublisher/DomainEventFailoverPublisher'; import { DomainEventJsonSerializer } from '../DomainEventJsonSerializer'; import { DomainEventSubscribers } from '../DomainEventSubscribers'; -import { RabbitMqConnection } from './RabbitMqConnection'; +import { RabbitMQConnection } from './RabbitMQConnection'; import { RabbitMQConsumerFactory } from './RabbitMQConsumerFactory'; import { RabbitMQqueueFormatter } from './RabbitMQqueueFormatter'; export class RabbitMQEventBus implements EventBus { private failoverPublisher: DomainEventFailoverPublisher; - private connection: RabbitMqConnection; + private connection: RabbitMQConnection; private exchange: string; private queueNameFormatter: RabbitMQqueueFormatter; private maxRetries: Number; constructor(params: { failoverPublisher: DomainEventFailoverPublisher; - connection: RabbitMqConnection; + connection: RabbitMQConnection; exchange: string; queueNameFormatter: RabbitMQqueueFormatter; maxRetries: Number; diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQExchangeNameFormatter.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQExchangeNameFormatter.ts similarity index 100% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQExchangeNameFormatter.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQExchangeNameFormatter.ts diff --git a/src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQqueueFormatter.ts b/src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQqueueFormatter.ts similarity index 100% rename from src/Contexts/Shared/infrastructure/EventBus/RabbitMq/RabbitMQqueueFormatter.ts rename to src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQqueueFormatter.ts diff --git a/src/apps/backoffice/backend/BackofficeBackendApp.ts b/src/apps/backoffice/backend/BackofficeBackendApp.ts index bdd7eb3..c2cfbdd 100644 --- a/src/apps/backoffice/backend/BackofficeBackendApp.ts +++ b/src/apps/backoffice/backend/BackofficeBackendApp.ts @@ -2,7 +2,7 @@ import { EventBus } from '../../../Contexts/Shared/domain/EventBus'; import container from './dependency-injection'; import { DomainEventSubscribers } from '../../../Contexts/Shared/infrastructure/EventBus/DomainEventSubscribers'; import { Server } from './server'; -import { RabbitMqConnection } from '../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; export class BackofficeBackendApp { server?: Server; @@ -21,15 +21,15 @@ export class BackofficeBackendApp { } async stop() { - const rabbitMQConnection = container.get('Backoffice.Shared.RabbitMQConnection'); - await rabbitMQConnection.close(); + const RabbitMQConnection = container.get('Backoffice.Shared.RabbitMQConnection'); + await RabbitMQConnection.close(); return this.server?.stop(); } private async configureEventBus() { const eventBus = container.get('Backoffice.Shared.domain.EventBus'); - const rabbitMQConnection = container.get('Backoffice.Shared.RabbitMQConnection'); - await rabbitMQConnection.connect(); + const RabbitMQConnection = container.get('Backoffice.Shared.RabbitMQConnection'); + await RabbitMQConnection.connect(); eventBus.addSubscribers(DomainEventSubscribers.from(container)); } diff --git a/src/apps/backoffice/backend/command/ConfigureRabbitMQCommand.ts b/src/apps/backoffice/backend/command/ConfigureRabbitMQCommand.ts index 66ba079..559854e 100644 --- a/src/apps/backoffice/backend/command/ConfigureRabbitMQCommand.ts +++ b/src/apps/backoffice/backend/command/ConfigureRabbitMQCommand.ts @@ -1,13 +1,13 @@ import { RabbitMQConfig } from '../../../../Contexts/Backoffice/Courses/infrastructure/RabbitMQ/RabbitMQConfigFactory'; import { DomainEventSubscribers } from '../../../../Contexts/Shared/infrastructure/EventBus/DomainEventSubscribers'; import { RabbitMQConfigurer } from '../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConfigurer'; -import { RabbitMqConnection } from '../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; import { RabbitMQqueueFormatter } from '../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQqueueFormatter'; import container from '../dependency-injection'; export class ConfigureRabbitMQCommand { static async run() { - const connection = container.get('Backoffice.Shared.RabbitMQConnection'); + const connection = container.get('Backoffice.Shared.RabbitMQConnection'); const nameFormatter = container.get('Backoffice.Shared.RabbitMQQueueFormatter'); const { exchangeSettings, retryTtl } = container.get('Backoffice.Shared.RabbitMQConfig'); diff --git a/src/apps/backoffice/backend/dependency-injection/Shared/application.yaml b/src/apps/backoffice/backend/dependency-injection/Shared/application.yaml index eb08d01..4695369 100644 --- a/src/apps/backoffice/backend/dependency-injection/Shared/application.yaml +++ b/src/apps/backoffice/backend/dependency-injection/Shared/application.yaml @@ -44,7 +44,7 @@ services: arguments: ['backoffice'] Backoffice.Shared.RabbitMQConnection: - class: ../../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection + class: ../../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection arguments: ['@Backoffice.Shared.RabbitMQConfig'] Backoffice.Shared.RabbitMQqueueFormatter: diff --git a/src/apps/backoffice/backend/routes/courses.route.ts b/src/apps/backoffice/backend/routes/courses.route.ts index ae2bd4f..b95f26b 100644 --- a/src/apps/backoffice/backend/routes/courses.route.ts +++ b/src/apps/backoffice/backend/routes/courses.route.ts @@ -1,12 +1,13 @@ import { Express } from 'express'; import container from '../dependency-injection'; import { CoursesPostController } from '../controllers/CoursesPostController'; +import { CoursesGetController } from '../controllers/CoursesGetController'; export const register = (app: Express) => { const coursesPostController: CoursesPostController = container.get( 'Apps.Backoffice.Backend.controllers.CoursesPostController' ); - const coursesGetController: CoursesPostController = container.get( + const coursesGetController: CoursesGetController = container.get( 'Apps.Backoffice.Backend.controllers.CoursesGetController' ); diff --git a/src/apps/mooc/backend/MoocBackendApp.ts b/src/apps/mooc/backend/MoocBackendApp.ts index 2eb7914..a0f0732 100644 --- a/src/apps/mooc/backend/MoocBackendApp.ts +++ b/src/apps/mooc/backend/MoocBackendApp.ts @@ -2,7 +2,7 @@ import { EventBus } from '../../../Contexts/Shared/domain/EventBus'; import container from './dependency-injection'; import { DomainEventSubscribers } from '../../../Contexts/Shared/infrastructure/EventBus/DomainEventSubscribers'; import { Server } from './server'; -import { RabbitMqConnection } from '../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; export class MoocBackendApp { server?: Server; @@ -21,15 +21,15 @@ export class MoocBackendApp { } async stop() { - const rabbitMQConnection = container.get('Mooc.Shared.RabbitMQConnection'); - await rabbitMQConnection.close(); + const RabbitMQConnection = container.get('Mooc.Shared.RabbitMQConnection'); + await RabbitMQConnection.close(); return this.server?.stop(); } private async configureEventBus() { const eventBus = container.get('Mooc.Shared.domain.EventBus'); - const rabbitMQConnection = container.get('Mooc.Shared.RabbitMQConnection'); - await rabbitMQConnection.connect(); + const RabbitMQConnection = container.get('Mooc.Shared.RabbitMQConnection'); + await RabbitMQConnection.connect(); eventBus.addSubscribers(DomainEventSubscribers.from(container)); } diff --git a/src/apps/mooc/backend/command/ConfigureRabbitMQCommand.ts b/src/apps/mooc/backend/command/ConfigureRabbitMQCommand.ts index 4fbbab1..26aa7bb 100644 --- a/src/apps/mooc/backend/command/ConfigureRabbitMQCommand.ts +++ b/src/apps/mooc/backend/command/ConfigureRabbitMQCommand.ts @@ -1,12 +1,12 @@ import { RabbitMQConfig } from '../../../../Contexts/Mooc/Shared/infrastructure/RabbitMQ/RabbitMQConfigFactory'; import { DomainEventSubscribers } from '../../../../Contexts/Shared/infrastructure/EventBus/DomainEventSubscribers'; import { RabbitMQConfigurer } from '../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConfigurer'; -import { RabbitMqConnection } from '../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; import container from '../dependency-injection'; export class ConfigureRabbitMQCommand { static async run() { - const connection = container.get('Mooc.Shared.RabbitMQConnection'); + const connection = container.get('Mooc.Shared.RabbitMQConnection'); const { name: exchange } = container.get('Mooc.Shared.RabbitMQConfig').exchangeSettings; await connection.connect(); diff --git a/src/apps/mooc/backend/dependency-injection/Shared/application.yaml b/src/apps/mooc/backend/dependency-injection/Shared/application.yaml index f11b664..fa74257 100644 --- a/src/apps/mooc/backend/dependency-injection/Shared/application.yaml +++ b/src/apps/mooc/backend/dependency-injection/Shared/application.yaml @@ -32,7 +32,7 @@ services: arguments: ['mooc'] Mooc.Shared.RabbitMQConnection: - class: ../../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection + class: ../../../../../Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection arguments: ['@Mooc.Shared.RabbitMQConfig'] Mooc.Shared.RabbitMQqueueFormatter: diff --git a/tests/Contexts/Shared/infrastructure/EventBus/RabbitMQEventBus.test.ts b/tests/Contexts/Shared/infrastructure/EventBus/RabbitMQEventBus.test.ts index bad1aae..d7706f1 100644 --- a/tests/Contexts/Shared/infrastructure/EventBus/RabbitMQEventBus.test.ts +++ b/tests/Contexts/Shared/infrastructure/EventBus/RabbitMQEventBus.test.ts @@ -3,7 +3,7 @@ import { DomainEventDeserializer } from '../../../../../src/Contexts/Shared/infr import { DomainEventFailoverPublisher } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/DomainEventFailoverPublisher/DomainEventFailoverPublisher'; import { DomainEventSubscribers } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/DomainEventSubscribers'; import { RabbitMQConfigurer } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConfigurer'; -import { RabbitMqConnection } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; import { RabbitMQConsumer } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConsumer'; import { RabbitMQEventBus } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQEventBus'; import { RabbitMQqueueFormatter } from '../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQqueueFormatter'; @@ -52,7 +52,7 @@ describe('RabbitMQEventBus test', () => { }); describe('integration', () => { - let connection: RabbitMqConnection; + let connection: RabbitMQConnection; let dummySubscriber: DomainEventSubscriberDummy; let configurer: RabbitMQConfigurer; let failoverPublisher: DomainEventFailoverPublisher; diff --git a/tests/Contexts/Shared/infrastructure/EventBus/__mocks__/RabbitMQConnectionDouble.ts b/tests/Contexts/Shared/infrastructure/EventBus/__mocks__/RabbitMQConnectionDouble.ts index d107794..ebcbb78 100644 --- a/tests/Contexts/Shared/infrastructure/EventBus/__mocks__/RabbitMQConnectionDouble.ts +++ b/tests/Contexts/Shared/infrastructure/EventBus/__mocks__/RabbitMQConnectionDouble.ts @@ -1,6 +1,6 @@ -import { RabbitMqConnection } from '../../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; -export class RabbitMQConnectionDouble extends RabbitMqConnection { +export class RabbitMQConnectionDouble extends RabbitMQConnection { async publish(params: any): Promise { throw new Error(); diff --git a/tests/Contexts/Shared/infrastructure/EventBus/__mother__/RabbitMQConnectionMother.ts b/tests/Contexts/Shared/infrastructure/EventBus/__mother__/RabbitMQConnectionMother.ts index b029f28..9c7b9b6 100644 --- a/tests/Contexts/Shared/infrastructure/EventBus/__mother__/RabbitMQConnectionMother.ts +++ b/tests/Contexts/Shared/infrastructure/EventBus/__mother__/RabbitMQConnectionMother.ts @@ -1,11 +1,11 @@ -import { RabbitMqConnection } from '../../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMqConnection'; +import { RabbitMQConnection } from '../../../../../../src/Contexts/Shared/infrastructure/EventBus/RabbitMQ/RabbitMQConnection'; import { RabbitMQConnectionDouble } from '../__mocks__/RabbitMQConnectionDouble'; import { RabbitMQConnectionConfigurationMother } from './RabbitMQConnectionConfigurationMother'; export class RabbitMQConnectionMother { static async create() { const config = RabbitMQConnectionConfigurationMother.create(); - const connection = new RabbitMqConnection(config); + const connection = new RabbitMQConnection(config); await connection.connect(); return connection; }