From 1be144f005cd419034224e2aafc78fdd94c25e61 Mon Sep 17 00:00:00 2001 From: meysamhadeli Date: Sat, 2 Jul 2022 00:44:10 +0430 Subject: [PATCH] . --- .../IntegrationTest/IntegrationTestFixture.cs | 122 +++++++++++------ .../IntegrationTest/IntegrationTestFixture.cs | 128 +++++++++--------- .../IntegrationTest/IntegrationTestFixture.cs | 90 +++++++----- .../src/Passenger/Data/PassengerDbContext.cs | 2 +- .../IntegrationTest/IntegrationTestFixture.cs | 90 +++++++----- 5 files changed, 258 insertions(+), 174 deletions(-) diff --git a/src/Services/Booking/tests/IntegrationTest/IntegrationTestFixture.cs b/src/Services/Booking/tests/IntegrationTest/IntegrationTestFixture.cs index 4669d52..0ee813c 100644 --- a/src/Services/Booking/tests/IntegrationTest/IntegrationTestFixture.cs +++ b/src/Services/Booking/tests/IntegrationTest/IntegrationTestFixture.cs @@ -1,12 +1,17 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Net.Http; using System.Threading.Tasks; using Booking.Data; +using BuildingBlocks.Contracts.Grpc; using BuildingBlocks.Core.Model; using BuildingBlocks.MassTransit; using BuildingBlocks.Mongo; using BuildingBlocks.Web; using Grpc.Net.Client; +using Integration.Test.Fakes; +using MagicOnion; using MassTransit; using MassTransit.Testing; using MediatR; @@ -35,12 +40,11 @@ public class FixtureCollection : ICollectionFixture public class IntegrationTestFixture : IAsyncLifetime { private WebApplicationFactory _factory; - public Checkpoint Checkpoint { get; set; } - + private Checkpoint _checkpoint; private MongoDbRunner _mongoRunner; - public Action? TestRegistrationServices { get; set; } - public IServiceProvider ServiceProvider => _factory.Services; - public IConfiguration Configuration => _factory.Services.GetRequiredService(); + private IServiceProvider _serviceProvider; + private Action? _testRegistrationServices; + private IConfiguration _configuration; public HttpClient HttpClient => _factory.CreateClient(); public ITestHarness TestHarness => CreateHarness(); public GrpcChannel Channel => CreateChannel(); @@ -53,68 +57,78 @@ public class IntegrationTestFixture : IAsyncLifetime builder.UseEnvironment("test"); builder.ConfigureServices(services => { - services.ReplaceSingleton(AddHttpContextAccessorMock); - TestRegistrationServices?.Invoke(services); - services.AddMassTransitTestHarness(x => - { - x.UsingRabbitMq((context, cfg) => - { - var rabbitMqOptions = services.GetOptions("RabbitMq"); - var host = rabbitMqOptions.HostName; - - cfg.Host(host, h => - { - h.Username(rabbitMqOptions.UserName); - h.Password(rabbitMqOptions.Password); - }); - cfg.ConfigureEndpoints(context); - }); - }); - - Checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; + _testRegistrationServices?.Invoke(services); }); }); - // _mongoRunner = MongoDbRunner.Start(); - // var mongoOptions = _factory.Services.GetRequiredService>(); - // if (mongoOptions is not null) - // mongoOptions.Value.ConnectionString = _mongoRunner.ConnectionString; + RegisterServices(services => + { + MockFlightGrpcServices(services); + MockPassengerGrpcServices(services); + services.ReplaceSingleton(AddHttpContextAccessorMock); + services.AddMassTransitTestHarness(x => + { + x.UsingRabbitMq((context, cfg) => + { + var rabbitMqOptions = services.GetOptions("RabbitMq"); + var host = rabbitMqOptions.HostName; + + cfg.Host(host, h => + { + h.Username(rabbitMqOptions.UserName); + h.Password(rabbitMqOptions.Password); + }); + cfg.ConfigureEndpoints(context); + }); + }); + }); + + _serviceProvider = _factory.Services; + _configuration = _factory.Services.GetRequiredService(); + + _checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; + + _mongoRunner = MongoDbRunner.Start(); + var mongoOptions = _factory.Services.GetRequiredService>(); + if (mongoOptions.Value.ConnectionString != null) + mongoOptions.Value.ConnectionString = _mongoRunner.ConnectionString; + return Task.CompletedTask; } + public void RegisterServices(Action services) => _testRegistrationServices = services; + public virtual async Task DisposeAsync() { - if (!string.IsNullOrEmpty(Configuration?.GetConnectionString("DefaultConnection"))) - await Checkpoint.Reset(Configuration?.GetConnectionString("DefaultConnection")); + if (!string.IsNullOrEmpty(_configuration?.GetConnectionString("DefaultConnection"))) + await _checkpoint.Reset(_configuration?.GetConnectionString("DefaultConnection")); await _factory.DisposeAsync(); + _mongoRunner.Dispose(); } // ref: https://github.com/trbenning/serilog-sinks-xunit public ILogger CreateLogger(ITestOutputHelper output) { if (output != null) + { return new LoggerConfiguration() .WriteTo.TestOutput(output) .CreateLogger(); + } return null; } - public void RegisterTestServices(Action services) - { - TestRegistrationServices = services; - } - public async Task ExecuteScopeAsync(Func action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); await action(scope.ServiceProvider); } public async Task ExecuteScopeAsync(Func> action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); var result = await action(scope.ServiceProvider); @@ -245,7 +259,7 @@ public class IntegrationTestFixture : IAsyncLifetime private ITestHarness CreateHarness() { - var harness = ServiceProvider.GetTestHarness(); + var harness = _serviceProvider.GetTestHarness(); harness.Start().GetAwaiter().GetResult(); return harness; } @@ -266,4 +280,36 @@ public class IntegrationTestFixture : IAsyncLifetime return httpContextAccessorMock; } + + private void MockPassengerGrpcServices(IServiceCollection services) + { + services.Replace(ServiceDescriptor.Singleton(x => + { + var mock = Substitute.For(); + mock.GetById(Arg.Any()) + .Returns(new UnaryResult(new FakePassengerResponseDto().Generate())); + + return mock; + })); + } + + private void MockFlightGrpcServices(IServiceCollection services) + { + services.Replace(ServiceDescriptor.Singleton(x => + { + var mock = Substitute.For(); + + mock.GetById(Arg.Any()) + .Returns(new UnaryResult(Task.FromResult(new FakeFlightResponseDto().Generate()))); + + mock.GetAvailableSeats(Arg.Any()) + .Returns( + new UnaryResult>(Task.FromResult(FakeSeatsResponseDto.Generate()))); + + mock.ReserveSeat(new FakeReserveSeatRequestDto().Generate()) + .Returns(new UnaryResult(Task.FromResult(FakeSeatsResponseDto.Generate().First()))); + + return mock; + })); + } } diff --git a/src/Services/Flight/tests/IntegrationTest/IntegrationTestFixture.cs b/src/Services/Flight/tests/IntegrationTest/IntegrationTestFixture.cs index 1b528a2..89ec2c1 100644 --- a/src/Services/Flight/tests/IntegrationTest/IntegrationTestFixture.cs +++ b/src/Services/Flight/tests/IntegrationTest/IntegrationTestFixture.cs @@ -2,14 +2,10 @@ using System.Net.Http; using System.Threading.Tasks; using BuildingBlocks.Core.Model; -using BuildingBlocks.EFCore; using BuildingBlocks.MassTransit; -using BuildingBlocks.MessageProcessor; using BuildingBlocks.Mongo; using BuildingBlocks.Web; -using DotNetCore.CAP.MongoDB; using Flight.Data; -using FluentAssertions.Common; using Grpc.Net.Client; using MassTransit; using MassTransit.Testing; @@ -17,11 +13,8 @@ using MediatR; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Testing; -using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using Mongo2Go; using NSubstitute; @@ -39,17 +32,76 @@ public class FixtureCollection : ICollectionFixture public class IntegrationTestFixture : IAsyncLifetime { + private Checkpoint _checkpoint; + private IConfiguration _configuration; private WebApplicationFactory _factory; - private MongoDbRunner _mongoRunner; - public Checkpoint Checkpoint { get; set; } - public Action? TestRegistrationServices { get; set; } - public IServiceProvider ServiceProvider => _factory.Services; - public IConfiguration Configuration => _factory.Services.GetRequiredService(); + private IServiceProvider _serviceProvider; + private Action? _testRegistrationServices; public HttpClient HttpClient => _factory.CreateClient(); public ITestHarness TestHarness => CreateHarness(); public GrpcChannel Channel => CreateChannel(); + + public virtual Task InitializeAsync() + { + _factory = new WebApplicationFactory() + .WithWebHostBuilder(builder => + { + builder.UseEnvironment("test"); + builder.ConfigureServices(services => + { + _testRegistrationServices?.Invoke(services); + }); + }); + + RegisterServices(services => + { + services.ReplaceSingleton(AddHttpContextAccessorMock); + services.AddMassTransitTestHarness(x => + { + x.UsingRabbitMq((context, cfg) => + { + var rabbitMqOptions = services.GetOptions("RabbitMq"); + var host = rabbitMqOptions.HostName; + + cfg.Host(host, h => + { + h.Username(rabbitMqOptions.UserName); + h.Password(rabbitMqOptions.Password); + }); + cfg.ConfigureEndpoints(context); + }); + }); + }); + + _serviceProvider = _factory.Services; + _configuration = _factory.Services.GetRequiredService(); + + _checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; + + _mongoRunner = MongoDbRunner.Start(); + var mongoOptions = _factory.Services.GetRequiredService>(); + if (mongoOptions.Value.ConnectionString != null) + mongoOptions.Value.ConnectionString = _mongoRunner.ConnectionString; + + return Task.CompletedTask; + } + + public virtual async Task DisposeAsync() + { + if (!string.IsNullOrEmpty(_configuration?.GetConnectionString("DefaultConnection"))) + await _checkpoint.Reset(_configuration?.GetConnectionString("DefaultConnection")); + + await _factory.DisposeAsync(); + _mongoRunner.Dispose(); + } + + public void RegisterServices(Action services) + { + _testRegistrationServices = services; + } + // ref: https://github.com/trbenning/serilog-sinks-xunit public ILogger CreateLogger(ITestOutputHelper output) { @@ -63,61 +115,15 @@ public class IntegrationTestFixture : IAsyncLifetime return null; } - public void RegisterTestServices(Action services) => TestRegistrationServices = services; - - public virtual Task InitializeAsync() - { - _factory = new WebApplicationFactory() - .WithWebHostBuilder(builder => - { - builder.UseEnvironment("test"); - builder.ConfigureServices(services => - { - services.AddMassTransitTestHarness(x => - { - x.UsingRabbitMq((context, cfg) => - { - var rabbitMqOptions = services.GetOptions("RabbitMq"); - var host = rabbitMqOptions.HostName; - - cfg.Host(host, h => - { - h.Username(rabbitMqOptions.UserName); - h.Password(rabbitMqOptions.Password); - }); - cfg.ConfigureEndpoints(context); - }); - }); - - Checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; - }); - }); - - _mongoRunner = MongoDbRunner.Start(); - var mongoOptions = _factory.Services.GetRequiredService>(); - mongoOptions.Value.ConnectionString = _mongoRunner.ConnectionString; - - return Task.CompletedTask; - } - - public virtual async Task DisposeAsync() - { - if (!string.IsNullOrEmpty(Configuration?.GetConnectionString("DefaultConnection"))) - await Checkpoint.Reset(Configuration?.GetConnectionString("DefaultConnection")); - - await _factory.DisposeAsync(); - _mongoRunner.Dispose(); - } - public async Task ExecuteScopeAsync(Func action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); await action(scope.ServiceProvider); } public async Task ExecuteScopeAsync(Func> action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); var result = await action(scope.ServiceProvider); @@ -248,7 +254,7 @@ public class IntegrationTestFixture : IAsyncLifetime private ITestHarness CreateHarness() { - var harness = ServiceProvider.GetTestHarness(); + var harness = _serviceProvider.GetTestHarness(); harness.Start().GetAwaiter().GetResult(); return harness; } diff --git a/src/Services/Identity/tests/IntegrationTest/IntegrationTestFixture.cs b/src/Services/Identity/tests/IntegrationTest/IntegrationTestFixture.cs index da891f6..cbce2d3 100644 --- a/src/Services/Identity/tests/IntegrationTest/IntegrationTestFixture.cs +++ b/src/Services/Identity/tests/IntegrationTest/IntegrationTestFixture.cs @@ -3,6 +3,7 @@ using System.Net.Http; using System.Threading.Tasks; using BuildingBlocks.Core.Model; using BuildingBlocks.MassTransit; +using BuildingBlocks.Mongo; using BuildingBlocks.Web; using Grpc.Net.Client; using Identity.Data; @@ -14,8 +15,8 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; +using Mongo2Go; using NSubstitute; using Respawn; using Serilog; @@ -31,15 +32,17 @@ public class FixtureCollection : ICollectionFixture public class IntegrationTestFixture : IAsyncLifetime { + private Checkpoint _checkpoint; + private IConfiguration _configuration; private WebApplicationFactory _factory; - public Checkpoint Checkpoint { get; set; } - public Action? TestRegistrationServices { get; set; } - public IServiceProvider ServiceProvider => _factory.Services; - public IConfiguration Configuration => _factory.Services.GetRequiredService(); + private MongoDbRunner _mongoRunner; + private IServiceProvider _serviceProvider; + private Action? _testRegistrationServices; public HttpClient HttpClient => _factory.CreateClient(); public ITestHarness TestHarness => CreateHarness(); public GrpcChannel Channel => CreateChannel(); + public virtual Task InitializeAsync() { _factory = new WebApplicationFactory() @@ -48,66 +51,79 @@ public class IntegrationTestFixture : IAsyncLifetime builder.UseEnvironment("test"); builder.ConfigureServices(services => { - services.ReplaceSingleton(AddHttpContextAccessorMock); - TestRegistrationServices?.Invoke(services); - services.AddMassTransitTestHarness(x => - { - x.UsingRabbitMq((context, cfg) => - { - var rabbitMqOptions = services.GetOptions("RabbitMq"); - var host = rabbitMqOptions.HostName; - - cfg.Host(host, h => - { - h.Username(rabbitMqOptions.UserName); - h.Password(rabbitMqOptions.Password); - }); - cfg.ConfigureEndpoints(context); - }); - }); - - Checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; - - TestRegistrationServices?.Invoke(services); + _testRegistrationServices?.Invoke(services); }); }); + RegisterServices(services => + { + services.ReplaceSingleton(AddHttpContextAccessorMock); + services.AddMassTransitTestHarness(x => + { + x.UsingRabbitMq((context, cfg) => + { + var rabbitMqOptions = services.GetOptions("RabbitMq"); + var host = rabbitMqOptions.HostName; + + cfg.Host(host, h => + { + h.Username(rabbitMqOptions.UserName); + h.Password(rabbitMqOptions.Password); + }); + cfg.ConfigureEndpoints(context); + }); + }); + }); + + _serviceProvider = _factory.Services; + _configuration = _factory.Services.GetRequiredService(); + + _checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; + + _mongoRunner = MongoDbRunner.Start(); + var mongoOptions = _factory.Services.GetRequiredService>(); + if (mongoOptions.Value.ConnectionString != null) + mongoOptions.Value.ConnectionString = _mongoRunner.ConnectionString; + return Task.CompletedTask; } public virtual async Task DisposeAsync() { - if (!string.IsNullOrEmpty(Configuration?.GetConnectionString("DefaultConnection"))) - await Checkpoint.Reset(Configuration?.GetConnectionString("DefaultConnection")); + if (!string.IsNullOrEmpty(_configuration?.GetConnectionString("DefaultConnection"))) + await _checkpoint.Reset(_configuration?.GetConnectionString("DefaultConnection")); await _factory.DisposeAsync(); + _mongoRunner.Dispose(); + } + + public void RegisterServices(Action services) + { + _testRegistrationServices = services; } // ref: https://github.com/trbenning/serilog-sinks-xunit public ILogger CreateLogger(ITestOutputHelper output) { if (output != null) + { return new LoggerConfiguration() .WriteTo.TestOutput(output) .CreateLogger(); + } return null; } - public void RegisterTestServices(Action services) - { - TestRegistrationServices = services; - } - public async Task ExecuteScopeAsync(Func action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); await action(scope.ServiceProvider); } public async Task ExecuteScopeAsync(Func> action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); var result = await action(scope.ServiceProvider); @@ -238,7 +254,7 @@ public class IntegrationTestFixture : IAsyncLifetime private ITestHarness CreateHarness() { - var harness = ServiceProvider.GetTestHarness(); + var harness = _serviceProvider.GetTestHarness(); harness.Start().GetAwaiter().GetResult(); return harness; } diff --git a/src/Services/Passenger/src/Passenger/Data/PassengerDbContext.cs b/src/Services/Passenger/src/Passenger/Data/PassengerDbContext.cs index 007f2c9..f2c48ea 100644 --- a/src/Services/Passenger/src/Passenger/Data/PassengerDbContext.cs +++ b/src/Services/Passenger/src/Passenger/Data/PassengerDbContext.cs @@ -9,7 +9,7 @@ public sealed class PassengerDbContext : AppDbContextBase { public const string DefaultSchema = "dbo"; - public PassengerDbContext(DbContextOptions options, IHttpContextAccessor httpContextAccessor) : base(options, httpContextAccessor) + public PassengerDbContext(DbContextOptions options, IHttpContextAccessor httpContextAccessor) : base(options, httpContextAccessor) { } diff --git a/src/Services/Passenger/tests/IntegrationTest/IntegrationTestFixture.cs b/src/Services/Passenger/tests/IntegrationTest/IntegrationTestFixture.cs index 11ef517..3e00083 100644 --- a/src/Services/Passenger/tests/IntegrationTest/IntegrationTestFixture.cs +++ b/src/Services/Passenger/tests/IntegrationTest/IntegrationTestFixture.cs @@ -3,6 +3,7 @@ using System.Net.Http; using System.Threading.Tasks; using BuildingBlocks.Core.Model; using BuildingBlocks.MassTransit; +using BuildingBlocks.Mongo; using BuildingBlocks.Web; using Grpc.Net.Client; using MassTransit; @@ -13,8 +14,8 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; +using Mongo2Go; using NSubstitute; using Passenger.Data; using Respawn; @@ -31,15 +32,17 @@ public class FixtureCollection : ICollectionFixture public class IntegrationTestFixture : IAsyncLifetime { + private Checkpoint _checkpoint; + private IConfiguration _configuration; private WebApplicationFactory _factory; - public Checkpoint Checkpoint { get; set; } - public Action? TestRegistrationServices { get; set; } - public IServiceProvider ServiceProvider => _factory.Services; - public IConfiguration Configuration => _factory.Services.GetRequiredService(); + private MongoDbRunner _mongoRunner; + private IServiceProvider _serviceProvider; + private Action? _testRegistrationServices; public HttpClient HttpClient => _factory.CreateClient(); public ITestHarness TestHarness => CreateHarness(); public GrpcChannel Channel => CreateChannel(); + public virtual Task InitializeAsync() { _factory = new WebApplicationFactory() @@ -48,66 +51,79 @@ public class IntegrationTestFixture : IAsyncLifetime builder.UseEnvironment("test"); builder.ConfigureServices(services => { - services.ReplaceSingleton(AddHttpContextAccessorMock); - TestRegistrationServices?.Invoke(services); - services.AddMassTransitTestHarness(x => - { - x.UsingRabbitMq((context, cfg) => - { - var rabbitMqOptions = services.GetOptions("RabbitMq"); - var host = rabbitMqOptions.HostName; - - cfg.Host(host, h => - { - h.Username(rabbitMqOptions.UserName); - h.Password(rabbitMqOptions.Password); - }); - cfg.ConfigureEndpoints(context); - }); - }); - - Checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; - - TestRegistrationServices?.Invoke(services); + _testRegistrationServices?.Invoke(services); }); }); + RegisterServices(services => + { + services.ReplaceSingleton(AddHttpContextAccessorMock); + services.AddMassTransitTestHarness(x => + { + x.UsingRabbitMq((context, cfg) => + { + var rabbitMqOptions = services.GetOptions("RabbitMq"); + var host = rabbitMqOptions.HostName; + + cfg.Host(host, h => + { + h.Username(rabbitMqOptions.UserName); + h.Password(rabbitMqOptions.Password); + }); + cfg.ConfigureEndpoints(context); + }); + }); + }); + + _serviceProvider = _factory.Services; + _configuration = _factory.Services.GetRequiredService(); + + _checkpoint = new Checkpoint {TablesToIgnore = new[] {"__EFMigrationsHistory"}}; + + _mongoRunner = MongoDbRunner.Start(); + var mongoOptions = _factory.Services.GetRequiredService>(); + if (mongoOptions.Value.ConnectionString != null) + mongoOptions.Value.ConnectionString = _mongoRunner.ConnectionString; + return Task.CompletedTask; } public virtual async Task DisposeAsync() { - if (!string.IsNullOrEmpty(Configuration?.GetConnectionString("DefaultConnection"))) - await Checkpoint.Reset(Configuration?.GetConnectionString("DefaultConnection")); + if (!string.IsNullOrEmpty(_configuration?.GetConnectionString("DefaultConnection"))) + await _checkpoint.Reset(_configuration?.GetConnectionString("DefaultConnection")); await _factory.DisposeAsync(); + _mongoRunner.Dispose(); + } + + public void RegisterServices(Action services) + { + _testRegistrationServices = services; } // ref: https://github.com/trbenning/serilog-sinks-xunit public ILogger CreateLogger(ITestOutputHelper output) { if (output != null) + { return new LoggerConfiguration() .WriteTo.TestOutput(output) .CreateLogger(); + } return null; } - public void RegisterTestServices(Action services) - { - TestRegistrationServices = services; - } - public async Task ExecuteScopeAsync(Func action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); await action(scope.ServiceProvider); } public async Task ExecuteScopeAsync(Func> action) { - using var scope = ServiceProvider.CreateScope(); + using var scope = _serviceProvider.CreateScope(); var result = await action(scope.ServiceProvider); @@ -238,7 +254,7 @@ public class IntegrationTestFixture : IAsyncLifetime private ITestHarness CreateHarness() { - var harness = ServiceProvider.GetTestHarness(); + var harness = _serviceProvider.GetTestHarness(); harness.Start().GetAwaiter().GetResult(); return harness; }