Skip to content
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
20 changes: 20 additions & 0 deletions src/Microcks.Testcontainers/Connection/GenericConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,32 @@

namespace Microcks.Testcontainers.Connection;

/// <summary>
/// Represents generic connection information (URL and optional credentials).
/// </summary>
public class GenericConnection
{
/// <summary>
/// Gets the connection URL.
/// </summary>
public string Url { get; }

/// <summary>
/// Gets the username used for authentication, if any.
/// </summary>
public string Username { get; }

/// <summary>
/// Gets the password used for authentication, if any.
/// </summary>
public string Password { get; }

/// <summary>
/// Initializes a new instance of the <see cref="GenericConnection"/> class.
/// </summary>
/// <param name="url">The connection URL.</param>
/// <param name="username">The username used for authentication, if any.</param>
/// <param name="password">The password used for authentication, if any.</param>
public GenericConnection(string url, string username = null, string password = null)
{
Url = url;
Expand Down
3 changes: 3 additions & 0 deletions src/Microcks.Testcontainers/Helpers/MacOSHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace Microcks.Testcontainers.Helpers;
/// </summary>
public static class MacOSHelper
{
/// <summary>
/// Gets a value indicating whether the current process is running on macOS (Darwin) on Arm64.
/// </summary>
public static bool IsMacOS { get; internal set; }
= RuntimeInformation.ProcessArchitecture == Architecture.Arm64
&& RuntimeInformation.OSDescription.Contains("Darwin");
Expand Down
33 changes: 33 additions & 0 deletions src/Microcks.Testcontainers/MicrocksContainerEnsemble.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@

private readonly INetwork _network;

/// <summary>
/// Gets the Docker network used by this ensemble.
/// </summary>
public INetwork Network { get => this._network; }


Expand Down Expand Up @@ -98,36 +101,66 @@
return this;
}

/// <summary>
/// Configures the Microcks container ensemble with the specified main remote artifacts.
/// </summary>
/// <param name="mainRemoteArtifacts">An array of remote artifact URIs/locations to be used by the Microcks container.</param>
/// <returns>The updated <see cref="MicrocksContainerEnsemble"/> instance.</returns>
public MicrocksContainerEnsemble WithMainRemoteArtifacts(params string[] mainRemoteArtifacts)
{
this._microcksBuilder.WithMainRemoteArtifacts(mainRemoteArtifacts);
return this;
}

/// <summary>
/// Configures the Microcks container ensemble with the specified main remote artifacts.
/// </summary>
/// <param name="remoteArtifacts">The remote artifact definitions to be used by the Microcks container.</param>
/// <returns>The updated <see cref="MicrocksContainerEnsemble"/> instance.</returns>
public MicrocksContainerEnsemble WithMainRemoteArtifacts(params RemoteArtifact[] remoteArtifacts)
{
this._microcksBuilder.WithMainRemoteArtifacts(remoteArtifacts);
return this;
}

/// <summary>
/// Configures the Microcks container ensemble with the specified secondary artifacts.
/// </summary>
/// <param name="secondaryArtifacts">An array of secondary artifact file names to be used by the Microcks container.</param>
/// <returns>The updated <see cref="MicrocksContainerEnsemble"/> instance.</returns>
public MicrocksContainerEnsemble WithSecondaryArtifacts(params string[] secondaryArtifacts)
{
this._microcksBuilder.WithSecondaryArtifacts(secondaryArtifacts);
return this;
}

/// <summary>
/// Configures the Microcks container ensemble with the specified secondary remote artifacts.
/// </summary>
/// <param name="remoteArtifacts">The remote artifact definitions to be used by the Microcks container.</param>
/// <returns>The updated <see cref="MicrocksContainerEnsemble"/> instance.</returns>
public MicrocksContainerEnsemble WithSecondaryRemoteArtifacts(params RemoteArtifact[] remoteArtifacts)
{
this._microcksBuilder.WithSecondaryRemoteArtifacts(remoteArtifacts);
return this;
}

/// <summary>
/// Configures the Microcks container ensemble with the specified snapshots.
/// </summary>
/// <param name="snapshots">An array of snapshot file names to be loaded into the Microcks container.</param>
/// <returns>The updated <see cref="MicrocksContainerEnsemble"/> instance.</returns>
public MicrocksContainerEnsemble WithSnapshots(params string[] snapshots)
{
this._microcksBuilder.WithSnapshots(snapshots);
return this;
}

/// <summary>
/// Configures the Microcks container ensemble with the specified secrets.
/// </summary>
/// <param name="secrets">The secrets to create in the Microcks container.</param>
/// <returns>The updated <see cref="MicrocksContainerEnsemble"/> instance.</returns>
public MicrocksContainerEnsemble WithSecrets(params Model.Secret[] secrets)
{
this._microcksBuilder.WithSecrets(secrets);
Expand All @@ -152,7 +185,7 @@
{
this._postmanBuilder = new ContainerBuilder()
.WithImage(image)
.WithNetwork(this._network)

Check warning on line 188 in src/Microcks.Testcontainers/MicrocksContainerEnsemble.cs

View workflow job for this annotation

GitHub Actions / 🔨 Build and test / build_test

'ContainerBuilder.ContainerBuilder()' is obsolete: 'This parameterless constructor is obsolete and will be removed. Use the constructor with the image parameter instead: https://github.com/testcontainers/testcontainers-dotnet/discussions/1470#discussioncomment-15185721.'
.WithNetworkAliases("postman")
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged(".*postman-runtime wrapper listening on port.*"));
return this;
Expand Down
Loading