Important: Always run from repository root: /home/darren/w/brighter/Brighter
# Async gateway
dotnet build src/Paramore.Brighter.MessagingGateway.RMQ.Async/Paramore.Brighter.MessagingGateway.RMQ.Async.csproj --no-incremental
# Sync gateway
dotnet build src/Paramore.Brighter.MessagingGateway.RMQ.Sync/Paramore.Brighter.MessagingGateway.RMQ.Sync.csproj --no-incremental# Async tests
dotnet build tests/Paramore.Brighter.RMQ.Async.Tests/Paramore.Brighter.RMQ.Async.Tests.csproj --no-incremental
# Sync tests
dotnet build tests/Paramore.Brighter.RMQ.Sync.Tests/Paramore.Brighter.RMQ.Sync.Tests.csproj --no-incrementalThese test configuration without needing RabbitMQ running:
# Async unit tests
dotnet test tests/Paramore.Brighter.RMQ.Async.Tests/Paramore.Brighter.RMQ.Async.Tests.csproj \
--filter "Category=MutualTLS&Requires!=Docker-mTLS" \
--framework net10.0
# Sync unit tests
dotnet test tests/Paramore.Brighter.RMQ.Sync.Tests/Paramore.Brighter.RMQ.Sync.Tests.csproj \
--filter "Category=MutualTLS&Requires!=Docker-mTLS" \
--framework net10.0
# Both together
dotnet test \
--filter "Category=MutualTLS&Requires!=Docker-mTLS" \
--framework net10.0 \
tests/Paramore.Brighter.RMQ.Async.Tests/Paramore.Brighter.RMQ.Async.Tests.csproj \
tests/Paramore.Brighter.RMQ.Sync.Tests/Paramore.Brighter.RMQ.Sync.Tests.csprojExpected Result: 14 tests pass (7 Async + 7 Sync)
These test actual mTLS connections to RabbitMQ.
# Install Docker (if not already installed)
sudo apt update
sudo apt install docker.io docker-compose -y
sudo systemctl start docker
sudo systemctl enable docker
# Add yourself to docker group (no more sudo needed)
sudo usermod -aG docker $USER
newgrp docker
# Generate certificates (only needed once)
cd tests
./generate-test-certs.sh
cd ..# 1. Start RabbitMQ with mTLS
docker-compose -f tests/docker-compose.rabbitmq-mtls.yml up -d
# 2. Wait for RabbitMQ to start
sleep 10
# 3. Verify RabbitMQ is running
docker ps | grep rabbitmq
# 4. Run Async acceptance tests
dotnet test tests/Paramore.Brighter.RMQ.Async.Tests/Paramore.Brighter.RMQ.Async.Tests.csproj \
--filter "Category=MutualTLS" \
--framework net10.0
# 5. Run Sync acceptance tests
dotnet test tests/Paramore.Brighter.RMQ.Sync.Tests/Paramore.Brighter.RMQ.Sync.Tests.csproj \
--filter "Category=MutualTLS" \
--framework net10.0
# 6. Stop RabbitMQ
docker-compose -f tests/docker-compose.rabbitmq-mtls.yml downExpected Result: 32 tests pass (16 Async + 16 Sync)
docker-compose -f tests/docker-compose.rabbitmq-mtls.yml up -d && \
sleep 10 && \
dotnet test --filter "Category=MutualTLS" --framework net10.0 \
tests/Paramore.Brighter.RMQ.Async.Tests/Paramore.Brighter.RMQ.Async.Tests.csproj \
tests/Paramore.Brighter.RMQ.Sync.Tests/Paramore.Brighter.RMQ.Sync.Tests.csproj && \
docker-compose -f tests/docker-compose.rabbitmq-mtls.yml downIf you see errors in projects like Paramore.Brighter.Base.Test, ignore them - they're unrelated to your changes. Always test specific projects to avoid running the entire solution.
# Add yourself to docker group
sudo usermod -aG docker $USER
# Apply group membership (or log out and back in)
newgrp docker# Always use net10.0 framework
dotnet test --framework net10.0 ...docker-compose -f tests/docker-compose.rabbitmq-mtls.yml logs -f# Stop everything
docker-compose -f tests/docker-compose.rabbitmq-mtls.yml down
# Remove old certificates
rm -rf tests/certs
# Regenerate certificates
cd tests && ./generate-test-certs.sh && cd ..
# Start fresh
docker-compose -f tests/docker-compose.rabbitmq-mtls.yml up -d- When certificate is configured, SSL is enabled
- When no certificate is configured, SSL is not configured
- When certificate object and path both set, object takes precedence
- When certificate path is provided, certificate is loaded
- When certificate file does not exist, throws FileNotFoundException
- When certificate file is invalid, throws InvalidOperationException
- When certificate configuration is optional, backwards compatibility is maintained
- When connecting with client certificate, can publish message
- When connecting with mTLS, can publish and receive message
- When publishing with trace context over mTLS (TraceParent preserved)
- When publishing with trace state over mTLS (TraceState preserved)
- When publishing with baggage over mTLS (Baggage preserved)
- When publishing with all trace context over mTLS
- When loading certificate from file path with trace context
- When using mTLS with quorum queues (trace context)
- When using mTLS with quorum queues (baggage)
On Windows, use PowerShell:
# Generate certificates
cd tests
.\generate-test-certs.ps1
cd ..
# Run tests (same dotnet commands work on Windows)