From 5b07db046eaf019012d7a98075a0c4e2b2358798 Mon Sep 17 00:00:00 2001 From: DanielHabenicht Date: Mon, 24 Oct 2022 11:10:27 +0000 Subject: [PATCH] refactor: use new testcontainers version do not use the workaround anymore --- tests/Tests.csproj | 2 +- tests/common/IntegrationTestFactory.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/Tests.csproj b/tests/Tests.csproj index aacf6f0..9608c89 100644 --- a/tests/Tests.csproj +++ b/tests/Tests.csproj @@ -24,7 +24,7 @@ - + diff --git a/tests/common/IntegrationTestFactory.cs b/tests/common/IntegrationTestFactory.cs index 5e87d75..721852b 100644 --- a/tests/common/IntegrationTestFactory.cs +++ b/tests/common/IntegrationTestFactory.cs @@ -16,8 +16,7 @@ public class IntegrationTestFactory : WebApplicationFactor public IntegrationTestFactory() { _container = new TestcontainersBuilder() - .WithDatabase(new MySqlTestcontainerConfiguration { Database = "datadonation", Username = "test123", Password = "example"}) - .WithEnvironment("MYSQL_ROOT_PASSWORD", "example") + .WithDatabase(new MySqlTestcontainerConfiguration { Database = "datadonation", Username = "root", Password = "example" }) .WithImage("mysql:8.0.29") .WithCleanUp(true) .Build(); @@ -40,7 +39,7 @@ protected override void ConfigureWebHost(IWebHostBuilder builder) } } - var connectionString = _container.ConnectionString.Replace("test123", "root") + ";OldGuids=true" ; + var connectionString = _container.ConnectionString + ";OldGuids=true"; var serverVersion = new MySqlServerVersion(ServerVersion.AutoDetect(connectionString));