Skip to content

Commit

Permalink
SIR-3153 remove incompatible package with MassTransit 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Sustretov committed Jan 12, 2024
1 parent 3c86454 commit fef531c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
25 changes: 0 additions & 25 deletions src/Swisschain.Extensions.Testing/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,5 @@ public static void RemoveDbSchemaValidationHost(this IServiceCollection services
services.Remove(descriptor);
}
}

public static void ReconfigureMassTransitInMemory(this IServiceCollection services)
{
var descriptors = services.Where(d =>
d.ServiceType.Namespace?.Contains("MassTransit", StringComparison.OrdinalIgnoreCase) == true)
.ToList();

foreach (var descriptor in descriptors)
{
services.Remove(descriptor);
}

services.AddMassTransitInMemoryTestHarness();
services.AddMassTransitBusHost();
services.AddSingleton<IBusControl>(c =>
{
var testHarness = c.GetRequiredService<InMemoryTestHarness>();
if (testHarness.BusControl == null)
{
testHarness.Start().GetAwaiter().GetResult();
}

return testHarness.BusControl;
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<PackageReference Include="Ductus.FluentDocker" Version="2.10.7" />
<PackageReference Include="Grpc.Net.Client" Version="2.48.0" />
<PackageReference Include="MassTransit" Version="7.2.4" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.2.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.9" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
// remove pending migrations checker
x.RemoveDbSchemaValidationHost();

// remove mass transit registrations and register anew with in-memory impl
x.ReconfigureMassTransitInMemory();

ConfigureServicesEx(x);
});
}
Expand Down

0 comments on commit fef531c

Please sign in to comment.