testcontainers / testcontainers-dotnet

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
https://dotnet.testcontainers.org
MIT License
3.73k stars 262 forks source link

feat: Add NATS module #1003

Closed niklasfp closed 11 months ago

niklasfp commented 11 months ago

What does this PR do?

This pr adds support for the official Nats Server image It should roughly align with the Go version providing support for .WithUsername and .WithPassword

The container enables the http monitoring endpoints of Nats, and exposes the default Nats server ports:

It also adds methods for getting a Nats connection string and the url for the monitoring endpoint.

Why is it important?

I needed it for my own work, and thought I might as well share it. And since Nats already has both Go and Node.js implementations, I guess others would benefit as well.

Related issues

N/A

How to test this PR

Tests has been added in this pr. Run the tests in ./tests/Testcontainers.Nats.Tests

netlify[bot] commented 11 months ago

Deploy Preview for testcontainers-dotnet ready!

Name Link
Latest commit b402f8be7b04c9b68fb435a15d9282da102e76c4
Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/6509e89a5c12dc000856789d
Deploy Preview https://deploy-preview-1003--testcontainers-dotnet.netlify.app/modules
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

niklasfp commented 11 months ago

@HofmeisterAn How should we handle this, you can rebase and merge if you see it fitting, or let me know what you need done from me 😄

HofmeisterAn commented 11 months ago

@HofmeisterAn How should we handle this, you can rebase and merge if you see it fitting, or let me know what you need done from me 😄

Ah, perhaps I misinterpreted it. I thought you were going to make changes according to the suggestion.

I'll ditch the null checks.

I am fine with the pull request; it looks good 👍, thanks! I can merge it later today when I am back home. Rebase, etc. is not necessary.

niklasfp commented 11 months ago

@HofmeisterAn cool!!