Skip to content

Commit b6070b9

Browse files
committed
feat: update integration tests
2 parents 50929e8 + 0de8cdd commit b6070b9

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

  • user-management/tests/Stickerlandia.UserManagement.IntegrationTest/Drivers
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2025 Datadog, Inc.
4+
5+
using System.Text.Json;
6+
using Amazon.SQS;
7+
using Confluent.Kafka;
8+
9+
namespace Stickerlandia.UserManagement.IntegrationTest.Drivers;
10+
11+
public class SqsMessaging : IMessaging, IAsyncDisposable
12+
{
13+
private readonly AmazonSQSClient client;
14+
private readonly Dictionary<string, string> queueUrlNameMap;
15+
public SqsMessaging(Dictionary<string, string> queueUrlNameMap)
16+
{
17+
client = new AmazonSQSClient();
18+
this.queueUrlNameMap = queueUrlNameMap;
19+
}
20+
public async Task SendMessageAsync(string queueName, object message)
21+
{
22+
if (!queueUrlNameMap.TryGetValue(queueName, out var queueUrl))
23+
{
24+
throw new ArgumentException($"Queue name '{queueName}' not found in the queue URL map.");
25+
}
26+
27+
await client.SendMessageAsync(queueUrl, JsonSerializer.Serialize(message));
28+
}
29+
30+
public async ValueTask DisposeAsync()
31+
{
32+
// Nothing to dispose
33+
}
34+
}

0 commit comments

Comments
 (0)