diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs index 6d0b8a3b19..a464fcc75f 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Stores; @@ -28,6 +29,7 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas private readonly IDistributedCache _clientCache; private readonly IDistributedCache _identityResourceCache; + private readonly IDistributedCache> _apiResourcesCache; private readonly IDistributedCache _apiResourceCache; private readonly IDistributedCache _apiScopeCache; private readonly IDistributedCache _resourceCache; @@ -46,6 +48,7 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas _clientCache = GetRequiredService>(); _identityResourceCache = GetRequiredService>(); + _apiResourcesCache = GetRequiredService>>(); _apiResourceCache = GetRequiredService>(); _apiScopeCache = GetRequiredService>(); _resourceCache = GetRequiredService>(); @@ -93,9 +96,9 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas (await _apiResourceCache.GetAsync(newApiResource2)).ShouldBeNull(); //FindApiResourcesByScopeNameAsync - (await _apiResourceCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldBeNull(); + (await _apiResourcesCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldBeNull(); await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { testApiResourceApiScopeName1 }); - (await _apiResourceCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldNotBeNull(); + (await _apiResourcesCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldNotBeNull(); var testApiResource1 = await _apiResourceRepository.FindByNameAsync(testApiResourceName1); await _apiResourceRepository.DeleteAsync(testApiResource1); diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs index c54c99e88d..27e3b04c5a 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs @@ -51,9 +51,9 @@ public class IdentityResourceStore_Tests : AbpIdentityServerTestBase })).ToList(); //Assert - apiResources.ShouldNotBe(null); + apiResources.ShouldNotBeNull(); - apiResources[0].Scopes.Count.ShouldBe(4); + apiResources.ShouldContain(x => x.Scopes.Contains("Test-ApiResource-ApiScope-Name-1")); } [Fact]