Skip to content

Commit 4174d6f

Browse files
committed
fix: Allow empty (default) consumer group names
1 parent 92d6dbc commit 4174d6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Testcontainers.EventHubs/EventHubsServiceConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public EventHubsServiceConfiguration WithEntity(string name, int partitionCount,
6666
{
6767
// Filter out the consumer group name `$default` because the `$default` group
6868
// is created automatically by the container image.
69-
var validConsumerGroupNames = consumerGroupNames.Where(consumerGroupName => !"$default".Equals(consumerGroupName, StringComparison.OrdinalIgnoreCase)).ToList();
69+
var validConsumerGroupNames = consumerGroupNames.Where(consumerGroupName => !"$Default".Equals(consumerGroupName, StringComparison.OrdinalIgnoreCase)).ToList();
7070
return WithEntity(name, partitionCount, new ReadOnlyCollection<string>(validConsumerGroupNames));
7171
}
7272

@@ -82,7 +82,7 @@ public bool Validate()
8282
{
8383
// The emulator provides the usage quotas as described at:
8484
// https://learn.microsoft.com/en-us/azure/event-hubs/overview-emulator#usage-quotas.
85-
Predicate<Entity> isValidEntity = entity => entity.PartitionCount > 0 && entity.PartitionCount <= 32 && entity.ConsumerGroups.Count > 0 && entity.ConsumerGroups.Count <= 20;
85+
Predicate<Entity> isValidEntity = entity => entity.PartitionCount > 0 && entity.PartitionCount <= 32 && entity.ConsumerGroups.Count <= 20;
8686
return _namespaceConfig.Entities.Count > 0 && _namespaceConfig.Entities.Count <= 10 && _namespaceConfig.Entities.All(entity => isValidEntity(entity));
8787
}
8888

tests/Testcontainers.EventHubs.Tests/EventHubsContainerTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Task DisposeAsync()
2626

2727
private static EventHubsServiceConfiguration GetServiceConfiguration()
2828
{
29-
return EventHubsServiceConfiguration.Create().WithEntity(EventHubsName, 2, [EventHubConsumerClient.DefaultConsumerGroupName, EventHubsConsumerGroupName]);
29+
return EventHubsServiceConfiguration.Create().WithEntity(EventHubsName, 2, EventHubConsumerClient.DefaultConsumerGroupName, EventHubsConsumerGroupName);
3030
}
3131

3232
[Fact]

0 commit comments

Comments
 (0)