1
0
mirror of synced 2024-12-03 16:13:09 +01:00

Temporary RabbitMQ.Client version fix for #41

Added test for incompatible queue arguments
This commit is contained in:
Mark van Renswoude 2023-03-30 15:45:13 +02:00
parent 8250a7181f
commit 5fc010a7e1
3 changed files with 46 additions and 3 deletions

View File

@ -33,7 +33,7 @@ namespace Tapeti.Tests.Client
private const string ImageName = "rabbitmq";
private const string ImageTag = "3.11.3-alpine";
private const string ImageTag = "3.11.3-management-alpine";
public async Task InitializeAsync()

View File

@ -1,7 +1,10 @@
using System.Text;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
using RabbitMQ.Client;
using Tapeti.Connection;
using Tapeti.Default;
using Tapeti.Exceptions;
@ -68,6 +71,31 @@ namespace Tapeti.Tests.Client
}
[Fact]
public async Task DurableQueueDeclareIncompatibleArguments()
{
using var rabbitmqClient = CreateRabbitMQClient();
using var model = rabbitmqClient.CreateModel();
var ok = model.QueueDeclare("incompatibleargs", true, false, false, new Dictionary<string, object>
{
{ "x-dead-letter-exchange", "d34db33f" }
});
model.Close();
rabbitmqClient.Close();
ok.Should().NotBeNull();
await client.DurableQueueDeclare("incompatibleargs", new QueueBinding[]
{
new("test", "#")
}, null, CancellationToken.None);
}
[Fact]
public async Task PublishHandleOverflow()
{
@ -97,6 +125,21 @@ namespace Tapeti.Tests.Client
// TODO test the other methods
private RabbitMQ.Client.IConnection CreateRabbitMQClient()
{
var connectionFactory = new ConnectionFactory
{
HostName = "127.0.0.1",
Port = fixture.RabbitMQPort,
UserName = RabbitMQFixture.RabbitMQUsername,
Password = RabbitMQFixture.RabbitMQPassword,
AutomaticRecoveryEnabled = false,
TopologyRecoveryEnabled = false
};
return connectionFactory.CreateConnection();
}
private TapetiClient CreateClient()
{

View File

@ -25,7 +25,7 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.*" />
<PackageReference Include="RabbitMQ.Client" Version="6.*" />
<PackageReference Include="RabbitMQ.Client" Version="[6.4]" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
</ItemGroup>