diff --git a/Tiku.IntegrationTests/Api/ContentManagementEndpointTests.cs b/Tiku.IntegrationTests/Api/ContentManagementEndpointTests.cs index 71ee459..249acd9 100644 --- a/Tiku.IntegrationTests/Api/ContentManagementEndpointTests.cs +++ b/Tiku.IntegrationTests/Api/ContentManagementEndpointTests.cs @@ -3,6 +3,8 @@ using System.Net.Http.Json; using System.Text.Json; using Microsoft.Extensions.DependencyInjection; using Tiku.Api.Contracts; +using Tiku.Application.Auth; +using Tiku.Application.Security; using Tiku.Domain.Catalog; using Tiku.Domain.Common; using Tiku.Domain.Content; @@ -305,6 +307,8 @@ public sealed class ContentManagementEndpointTests item.TenantId == tenantId && item.Code == "integration_test_admin"); role.DataScope = JsonSerializer.SerializeToElement(value); await dbContext.SaveChangesAsync(); + await scope.ServiceProvider.GetRequiredService() + .BumpScopeAsync(AuthRealm.Tenant, tenantId); } private static async Task ReadJsonAsync(HttpResponseMessage response) @@ -312,4 +316,4 @@ public sealed class ContentManagementEndpointTests var stream = await response.Content.ReadAsStreamAsync(); return await JsonDocument.ParseAsync(stream); } -} \ No newline at end of file +} diff --git a/Tiku.IntegrationTests/Api/TenantCommerceEndpointTests.cs b/Tiku.IntegrationTests/Api/TenantCommerceEndpointTests.cs index 227aac2..bb2fcfd 100644 --- a/Tiku.IntegrationTests/Api/TenantCommerceEndpointTests.cs +++ b/Tiku.IntegrationTests/Api/TenantCommerceEndpointTests.cs @@ -7,6 +7,8 @@ using Microsoft.Extensions.DependencyInjection; using Tiku.Api.Contracts; using Tiku.Application.Commerce; using Tiku.Application.Jobs; +using Tiku.Application.Auth; +using Tiku.Application.Security; using Tiku.Domain.Catalog; using Tiku.Domain.Commerce; using Tiku.Domain.Identity; @@ -676,6 +678,8 @@ public sealed class TenantCommerceEndpointTests item.TenantId == tenantId && item.Code == "integration_test_admin"); role.DataScope = JsonSerializer.SerializeToElement(value); await dbContext.SaveChangesAsync(); + await scope.ServiceProvider.GetRequiredService() + .BumpScopeAsync(AuthRealm.Tenant, tenantId); } private sealed record LoginSeed(Guid TenantId, Guid UserId, string Phone); @@ -698,4 +702,4 @@ public sealed class TenantCommerceEndpointTests throw new NotSupportedException(); } } -} \ No newline at end of file +}