Implement owner-scoped Observation lifecycle with serialized patches
This commit is contained in:
1 parent
bfe6ebf5af
commit
3a70e3e296
37 files changed
+31249
-9
No files matched your search
@@ -0,0 +1,19 @@
|
||||
using HealthApp.Observations.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Npgsql;
|
||||
namespace Observation.AcceptanceTests;
|
||||
public sealed class ObservationApiFixture : PatientProfile.AcceptanceTests.PatientApiFixture
|
||||
{
|
||||
private string? healthyConnection;
|
||||
public string ObservationConnectionString=>ConnectionString;
|
||||
internal ObservationDbContext CreateObservationDbContext()=>new(new DbContextOptionsBuilder<ObservationDbContext>().UseNpgsql(ConnectionString).Options);
|
||||
public async Task StopPatientServiceAsync(){healthyConnection=RuntimeConnectionString;RuntimeConnectionString=new NpgsqlConnectionStringBuilder(RuntimeConnectionString){Host="127.0.0.1",Port=1,Timeout=1}.ConnectionString;await base.RestartHostsAsync();}
|
||||
public Task StopObservationServiceAsync()=>StopPatientServiceAsync();
|
||||
public Task StopInsightsServiceAsync()=>StopPatientServiceAsync();
|
||||
public Task StopOverviewServiceAsync()=>StopPatientServiceAsync();
|
||||
public override async Task RestartHostsAsync(){if(healthyConnection is not null){RuntimeConnectionString=healthyConnection;healthyConnection=null;}await base.RestartHostsAsync();}
|
||||
public HttpClient CreateDirectPatientClient()=>new(){BaseAddress=RawClient.BaseAddress};
|
||||
public HttpClient CreateDirectObservationClient()=>CreateDirectPatientClient();
|
||||
public HttpClient CreateDirectInsightsClient()=>CreateDirectPatientClient();
|
||||
public HttpClient CreateDirectOverviewClient()=>CreateDirectPatientClient();
|
||||
}
|
||||
Reference in new issue
Block a user