After updating to ABP 5.0, our unit tests started to give exceptions about related project's (Domain project which has RabbitMQ connection configuration) RabbitMQ broker connection if it is not connected to broker. In the previous versions unit tests didn't crush when this connection was not established. As a note: Our unit tests don't have any configuration about broker. It crushes because they are using the Domain project.
5 Answer(s)
-
0
What is your previous version?
Is there an error just because of upgrading to 5.0?
You should exclude Rabbitmq from your unit tests.
-
0
What is your previous version?
Is there an error just because of upgrading to 5.0?
You should exclude Rabbitmq from your unit tests.
Previous version was 4.4.2.
Unit Test projects have reference to Domain project and Domain project is trying to connect to broker(RabbitMQ). In the previous version, the failure of Domain project connection, did not prevent the unit tests from passing.
I did not change anything besides version update.
-
0
Domain project is trying to connect to broker(RabbitMQ)
You can try to prevent it from connecting in the unit test. eg: Create a service to connecting then mock it in the unit test.
-
0
Domain project is trying to connect to broker(RabbitMQ)
You can try to prevent it from connecting in the unit test.eg: Create a service to connecting then mock it in the unit test.
Can you explain a little more, please?
My project's DomainModule looks like below, and I configure the broker from here.
-
0
hi
You can add a service to configure
AbpRabbitMqOptions
. Remove this service from DI in the unit test.https://andrewlock.net/simplifying-dependency-injection-for-iconfigureoptions-with-the-configureoptions-helper/