Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork/rafek1241/feature/add azure event hubs #1

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Testcontainers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch", "src\Testcontainers.Elasticsearch\Testcontainers.Elasticsearch.csproj", "{641DDEA5-B6E0-41E6-BA11-7A28C0913127}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventHubs", "src\Testcontainers.EventHubs\Testcontainers.EventHubs.csproj", "{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb", "src\Testcontainers.EventStoreDb\Testcontainers.EventStoreDb.csproj", "{84D707E0-C9FA-4327-85DC-0AFEBEA73572}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FakeGcsServer", "src\Testcontainers.FakeGcsServer\Testcontainers.FakeGcsServer.csproj", "{FF86B509-2F9E-4269-ABC2-912B3339DE29}"
Expand Down Expand Up @@ -137,6 +139,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.DynamoDb.Tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Elasticsearch.Tests", "tests\Testcontainers.Elasticsearch.Tests\Testcontainers.Elasticsearch.Tests.csproj", "{DD5B3678-468F-4D73-AECE-705E3D66CD43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventHubs.Tests", "tests\Testcontainers.EventHubs.Tests\Testcontainers.EventHubs.Tests.csproj", "{4A0C5523-CEB2-49C9-AE62-9187A01B016B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventStoreDb.Tests", "tests\Testcontainers.EventStoreDb.Tests\Testcontainers.EventStoreDb.Tests.csproj", "{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.FakeGcsServer.Tests", "tests\Testcontainers.FakeGcsServer.Tests\Testcontainers.FakeGcsServer.Tests.csproj", "{9F27AA1B-C25D-400C-BCB0-6B0BF1A1DCEA}"
Expand Down Expand Up @@ -209,10 +213,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.WebDriver.Te
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.Xunit.Tests", "tests\Testcontainers.Xunit.Tests\Testcontainers.Xunit.Tests.csproj", "{E901DF14-6F05-4FC2-825A-3055FAD33561}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventHubs", "src\Testcontainers.EventHubs\Testcontainers.EventHubs.csproj", "{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.EventHubs.Tests", "tests\Testcontainers.EventHubs.Tests\Testcontainers.EventHubs.Tests.csproj", "{4A0C5523-CEB2-49C9-AE62-9187A01B016B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -274,6 +274,10 @@ Global
{641DDEA5-B6E0-41E6-BA11-7A28C0913127}.Debug|Any CPU.Build.0 = Debug|Any CPU
{641DDEA5-B6E0-41E6-BA11-7A28C0913127}.Release|Any CPU.ActiveCfg = Release|Any CPU
{641DDEA5-B6E0-41E6-BA11-7A28C0913127}.Release|Any CPU.Build.0 = Release|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Release|Any CPU.Build.0 = Release|Any CPU
{84D707E0-C9FA-4327-85DC-0AFEBEA73572}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84D707E0-C9FA-4327-85DC-0AFEBEA73572}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84D707E0-C9FA-4327-85DC-0AFEBEA73572}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -470,6 +474,10 @@ Global
{DD5B3678-468F-4D73-AECE-705E3D66CD43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD5B3678-468F-4D73-AECE-705E3D66CD43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD5B3678-468F-4D73-AECE-705E3D66CD43}.Release|Any CPU.Build.0 = Release|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Release|Any CPU.Build.0 = Release|Any CPU
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -614,14 +622,6 @@ Global
{E901DF14-6F05-4FC2-825A-3055FAD33561}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E901DF14-6F05-4FC2-825A-3055FAD33561}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E901DF14-6F05-4FC2-825A-3055FAD33561}.Release|Any CPU.Build.0 = Release|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3}.Release|Any CPU.Build.0 = Release|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A0C5523-CEB2-49C9-AE62-9187A01B016B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5365F780-0E6C-41F0-B1B9-7DC34368F80C} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
Expand All @@ -637,6 +637,7 @@ Global
{DCECB1F6-D9AA-431F-AE42-25D56B9E7DFC} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{2EAFA567-9F68-4C52-9DBC-8F3EC11BB2CE} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{641DDEA5-B6E0-41E6-BA11-7A28C0913127} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{84D707E0-C9FA-4327-85DC-0AFEBEA73572} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{FF86B509-2F9E-4269-ABC2-912B3339DE29} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{31BAF2C4-0608-4C0F-845A-14FE7C0A1670} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
Expand Down Expand Up @@ -686,6 +687,7 @@ Global
{DA54916E-1128-4200-B6AE-9F5BF02D832D} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{101515E6-74C1-40F9-85C8-871F742A378D} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{DD5B3678-468F-4D73-AECE-705E3D66CD43} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{4A0C5523-CEB2-49C9-AE62-9187A01B016B} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{64F8E9B9-78FD-4E13-BDDF-0340E2D4E1D0} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{9F27AA1B-C25D-400C-BCB0-6B0BF1A1DCEA} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{E39095AC-9B34-4178-A486-04C902B6FD33} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
Expand Down Expand Up @@ -722,7 +724,5 @@ Global
{DDB41BC8-5826-4D97-9C5F-001151E3FFD6} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{EBA72C3B-57D5-43FF-A5B4-3D55B3B6D4C2} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{E901DF14-6F05-4FC2-825A-3055FAD33561} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
{0EF885E9-E973-47DC-AA9C-3A5E9175B0F3} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
{4A0C5523-CEB2-49C9-AE62-9187A01B016B} = {7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}
EndGlobalSection
EndGlobal
15 changes: 6 additions & 9 deletions src/Testcontainers.Azurite/AzuriteContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,27 @@ public string GetConnectionString()
/// <summary>
/// Gets the blob endpoint
/// </summary>
/// <returns>The azurite blob endpoint</returns>
/// <returns>The Azurite blob endpoint</returns>
public string GetBlobEndpoint()
{
return new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.BlobPort),
AzuriteBuilder.AccountName).ToString();
return new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.BlobPort), AzuriteBuilder.AccountName).ToString();
}

/// <summary>
/// Gets the queue endpoint
/// </summary>
/// <returns>The azurite queue endpoint</returns>
/// <returns>The Azurite queue endpoint</returns>
public string GetQueueEndpoint()
{
return new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.QueuePort),
AzuriteBuilder.AccountName).ToString();
return new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.QueuePort), AzuriteBuilder.AccountName).ToString();
}

/// <summary>
/// Gets the table endpoint
/// </summary>
/// <returns>The azurite table endpoint</returns>
/// <returns>The Azurite table endpoint</returns>
public string GetTableEndpoint()
{
return new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.TablePort),
AzuriteBuilder.AccountName).ToString();
return new UriBuilder(Uri.UriSchemeHttp, Hostname, GetMappedPublicPort(AzuriteBuilder.TablePort), AzuriteBuilder.AccountName).ToString();
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace Testcontainers.EventHubs.Configuration;
namespace Testcontainers.EventHubs.Configuration;

public class ConfigurationBuilder
{
private const string DefaultNamespace = "emulatorNs1";
private const string DefaultLoggingType = "file";

private readonly RootConfiguration _rootConfiguration = new RootConfiguration();

private ConfigurationBuilder()
{
_rootConfiguration.UserConfig = new UserConfig
Expand All @@ -27,7 +27,7 @@ public static ConfigurationBuilder Create()
{
return new ConfigurationBuilder();
}

public ConfigurationBuilder WithEventHub(string entityName, int partitionCount, IEnumerable<string> consumerGroups)
{
var namespaceConfig = _rootConfiguration.UserConfig.NamespaceConfig.FirstOrDefault(x => x.Name == DefaultNamespace);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Testcontainers.EventHubs.Configuration;
namespace Testcontainers.EventHubs.Configuration;

public record ConsumerGroup
{
Expand Down
2 changes: 1 addition & 1 deletion src/Testcontainers.EventHubs/Configuration/Entity.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Testcontainers.EventHubs.Configuration;
namespace Testcontainers.EventHubs.Configuration;

public record Entity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Testcontainers.EventHubs.Configuration;
namespace Testcontainers.EventHubs.Configuration;

public record LoggingConfig
{
Expand Down
4 changes: 2 additions & 2 deletions src/Testcontainers.EventHubs/Configuration/NamespaceConfig.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Testcontainers.EventHubs.Configuration;
namespace Testcontainers.EventHubs.Configuration;

public record NamespaceConfig
{
public string Type { get; set; }
public string Name { get; set; }

public List<Entity> Entities { get; set; } = [];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Testcontainers.EventHubs.Configuration;
namespace Testcontainers.EventHubs.Configuration;

/// <summary>
/// Azure Event Hubs emulator JSON configuration.
Expand Down
2 changes: 1 addition & 1 deletion src/Testcontainers.EventHubs/Configuration/UserConfig.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Testcontainers.EventHubs.Configuration;
namespace Testcontainers.EventHubs.Configuration;

public record UserConfig
{
Expand Down
133 changes: 60 additions & 73 deletions src/Testcontainers.EventHubs/EventHubsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ namespace Testcontainers.EventHubs;
[PublicAPI]
public sealed class EventHubsBuilder : ContainerBuilder<EventHubsBuilder, EventHubsContainer, EventHubsConfiguration>
{
public const string EventHubsNetworkAlias = "eventhubs-container";

public const string AzuriteNetworkAlias = "azurite-container";

public const string EventHubsImage = "mcr.microsoft.com/azure-messaging/eventhubs-emulator:latest";

public const ushort EventHubsPort = 5672;

public const string EventHubNetworkAlias = "eventhub";
public const string AzuriteNetworkAlias = "azurite";
public const ushort KafkaPort = 9092;

private const string AcceptLicenseAgreementEnvVar = "ACCEPT_EULA";

Expand Down Expand Up @@ -39,20 +42,6 @@ private EventHubsBuilder(EventHubsConfiguration resourceConfiguration)
/// <inheritdoc />
protected override EventHubsConfiguration DockerResourceConfiguration { get; }

/// <summary>
/// Sets the event hub configuration
/// </summary>
/// <param name="configurationBuilder"></param>
/// <returns></returns>
public EventHubsBuilder WithConfigurationBuilder(ConfigurationBuilder configurationBuilder)
{
var configBytes = Encoding.UTF8.GetBytes(configurationBuilder.Build());

return Merge(DockerResourceConfiguration,
new EventHubsConfiguration(configurationBuilder: configurationBuilder))
.WithResourceMapping(configBytes, "Eventhubs_Emulator/ConfigFiles/Config.json");
}

/// <summary>
/// Accepts the license agreement.
/// </summary>
Expand All @@ -68,96 +57,94 @@ public EventHubsBuilder WithAcceptLicenseAgreement(bool acceptLicenseAgreement)
}

/// <summary>
/// Sets the Azurite container for the Event Hubs Emulator.
/// Sets the dependent Azurite container for the Azure Event Hubs Emulator.
/// </summary>
/// <param name="azuriteContainer">docker container</param>
/// <param name="alias">network alias name that is used for connection to blob and table endpoints</param>
/// <returns></returns>
public EventHubsBuilder WithAzurite(AzuriteContainer azuriteContainer,
string alias) =>
WithAzurite(azuriteContainer, false, alias);

private EventHubsBuilder WithAzurite(AzuriteContainer azuriteContainer,
bool isInternal,
string alias = AzuriteNetworkAlias)
/// <remarks>
/// This method allows an existing Azurite container to be attached to the Azure Event
/// Hubs Emulator. The containers must be on the same network to enable communication
/// between them.
/// </remarks>
/// <param name="network">The network to connect the container to.</param>
/// <param name="container">The Azure container.</param>
/// <param name="networkAlias">The Azure container network alias.</param>
/// <returns>A configured instance of <see cref="EventHubsBuilder" />.</returns>
public EventHubsBuilder WithAzuriteContainer(
INetwork network,
AzuriteContainer container,
string networkAlias)
{
var builder = Merge(DockerResourceConfiguration,
new EventHubsConfiguration(azuriteContainer: azuriteContainer));

if (!isInternal)
{
builder = builder.DependsOn(azuriteContainer);
}

return builder
.WithEnvironment("BLOB_SERVER", alias)
.WithEnvironment("METADATA_SERVER", alias);
return Merge(DockerResourceConfiguration, new EventHubsConfiguration(azuriteContainer: container))
.DependsOn(container)
.WithNetwork(network)
.WithNetworkAliases(EventHubsNetworkAlias)
.WithEnvironment("BLOB_SERVER", networkAlias)
.WithEnvironment("METADATA_SERVER", networkAlias);
}

private EventHubsBuilder WithAzurite()
/// <summary>
/// Sets the Azure Event Hubs Emulator configuration.
/// </summary>
/// <param name="configurationBuilder">The configuration.</param>
/// <returns>A configured instance of <see cref="EventHubsBuilder" />.</returns>
public EventHubsBuilder WithConfigurationBuilder(ConfigurationBuilder configurationBuilder)
{
var azuriteContainer = new AzuriteBuilder()
.WithNetwork(DockerResourceConfiguration.Networks.Single())
.WithNetworkAliases(AzuriteNetworkAlias)
.Build();

return WithAzurite(azuriteContainer, true);
var resourceContent = Encoding.Default.GetBytes(configurationBuilder.Build());
return Merge(DockerResourceConfiguration, new EventHubsConfiguration(configurationBuilder: configurationBuilder))
.WithResourceMapping(resourceContent, "Eventhubs_Emulator/ConfigFiles/Config.json");
}

/// <inheritdoc />
public override EventHubsContainer Build()
{
Validate();

var builder = this;

if (!DockerResourceConfiguration.Networks.Any())
if (DockerResourceConfiguration.AzuriteContainer != null)
{
builder = builder.WithNetwork(new NetworkBuilder().Build());
return new EventHubsContainer(DockerResourceConfiguration);
}

if (DockerResourceConfiguration.AzuriteContainer == null)
{
builder = builder.WithAzurite();
}

return new EventHubsContainer(builder.DockerResourceConfiguration);

// If the user has not provided an existing Azurite container instance,
// we configure one.
var network = new NetworkBuilder()
.Build();

var container = new AzuriteBuilder()
.WithNetwork(network)
.WithNetworkAliases(AzuriteNetworkAlias)
.Build();

var eventHubsContainer = WithAzuriteContainer(network, container, AzuriteNetworkAlias);
return new EventHubsContainer(eventHubsContainer.DockerResourceConfiguration);
}

/// <inheritdoc />
protected override void Validate()
{
const string message = "The image '{0}' requires you to accept a license agreement.";

base.Validate();

Predicate<EventHubsConfiguration> licenseAgreementNotAccepted = value =>
!value.Environments.TryGetValue(AcceptLicenseAgreementEnvVar, out var licenseAgreementValue) || !AcceptLicenseAgreement.Equals(licenseAgreementValue, StringComparison.Ordinal);

_ = Guard.Argument(DockerResourceConfiguration, nameof(DockerResourceConfiguration.Image))
.ThrowIf(argument => LicenseAgreementNotAccepted(argument.Value),
argument => throw new ArgumentException(
$"The image '{DockerResourceConfiguration.Image.FullName}' requires you to accept a license agreement.",
argument.Name));
.ThrowIf(argument => licenseAgreementNotAccepted(argument.Value), argument => throw new ArgumentException(string.Format(message, DockerResourceConfiguration.Image.FullName), argument.Name));

_ = Guard.Argument(DockerResourceConfiguration.ConfigurationBuilder,
nameof(DockerResourceConfiguration.ConfigurationBuilder))
_ = Guard.Argument(DockerResourceConfiguration.ConfigurationBuilder, nameof(DockerResourceConfiguration.ConfigurationBuilder))
.NotNull()
.ThrowIf(x => !x.Value.Validate(), _ => throw new ArgumentException("ConfigurationBuilder is invalid."));

return;

bool LicenseAgreementNotAccepted(EventHubsConfiguration value) =>
!value.Environments.TryGetValue(AcceptLicenseAgreementEnvVar, out var licenseAgreementValue) ||
!AcceptLicenseAgreement.Equals(licenseAgreementValue, StringComparison.Ordinal);
.ThrowIf(argument => !argument.Value.Validate(), _ => throw new ArgumentException("ConfigurationBuilder is invalid."));
}

/// <inheritdoc />
protected override EventHubsBuilder Init()
{
return base.Init()
.WithImage(EventHubsImage)
.WithNetworkAliases(EventHubNetworkAlias)
.WithPortBinding(EventHubsPort, true)
.WithPortBinding(KafkaPort, true)
.WithWaitStrategy(Wait.ForUnixContainer()
.UntilMessageIsLogged("Emulator Service is Successfully Up!")
.AddCustomWaitStrategy(new WaitTwoSeconds()));
;
}

/// <inheritdoc />
Expand All @@ -173,12 +160,12 @@ protected override EventHubsBuilder Clone(IContainerConfiguration resourceConfig
}

/// <inheritdoc />
protected override EventHubsBuilder Merge(EventHubsConfiguration oldValue,
EventHubsConfiguration newValue)
protected override EventHubsBuilder Merge(EventHubsConfiguration oldValue, EventHubsConfiguration newValue)
{
return new EventHubsBuilder(new EventHubsConfiguration(oldValue, newValue));
}

/// <inheritdoc />
private sealed class WaitTwoSeconds : IWaitUntil
{
/// <inheritdoc />
Expand Down
Loading