namespace Azaion.Missions.E2E;
///
/// Base class for blackbox HTTP tests against the missions service. Owns the
/// shared HttpClient that talks to MISSIONS_BASE_URL and the
/// that fetches signed JWTs from jwks-mock.
///
///
/// Tests should NEVER add a project reference to Azaion.Missions.csproj
/// — assertions about internal state go through the Npgsql side-channel
/// () instead.
///
public abstract class TestBase : IDisposable
{
protected HttpClient Missions { get; }
protected TokenMinter Tokens { get; }
private bool _disposed;
protected TestBase()
{
Missions = new HttpClient
{
BaseAddress = new Uri(TestEnvironment.MissionsBaseUrl),
Timeout = TimeSpan.FromSeconds(30)
};
Tokens = new TokenMinter(TestEnvironment.JwksMockSignUrl);
}
public void Dispose()
{
if (_disposed) return;
_disposed = true;
Missions.Dispose();
Tokens.Dispose();
GC.SuppressFinalize(this);
}
}