From ac977cce63f3ddb0b65eb073d5b339b31f2287a4 Mon Sep 17 00:00:00 2001 From: Luk Vermeulen Date: Sat, 22 Aug 2020 13:18:20 +0200 Subject: [PATCH] add missing ConfigureAwait(false) --- .../Extensions/FlurlRequestExtensions.cs | 22 +++--- src/Keycloak.Net/Users/KeycloakClient.cs | 4 +- .../AttackDetection/KeycloakClientShould.cs | 4 +- .../KeycloakClientShould.cs | 40 +++++----- .../KeycloakClientShould.cs | 4 +- .../KeycloakClientShould.cs | 2 +- .../KeycloakClientShould.cs | 2 +- .../KeycloakClientShould.cs | 36 ++++----- .../ClientScopes/KeycloakClientShould.cs | 6 +- .../Clients/KeycloakClientShould.cs | 78 +++++++++---------- .../Components/KeycloakClientShould.cs | 6 +- .../Groups/KeycloakClientShould.cs | 14 ++-- .../IdentityProviders/KeycloakClientShould.cs | 28 +++---- .../Key/KeycloakClientShould.cs | 2 +- .../ProtocolMappers/KeycloakClientShould.cs | 16 ++-- .../RealmsAdmin/KeycloakClientShould.cs | 24 +++--- .../RoleMapper/KeycloakClientShould.cs | 32 ++++---- .../Roles/KeycloakClientShould.cs | 78 +++++++++---------- .../RolesById/KeycloakClientShould.cs | 22 +++--- .../Root/KeycloakClientShould.cs | 2 +- .../ScopeMappings/KeycloakClientShould.cs | 66 ++++++++-------- .../KeycloakClientShould.cs | 4 +- .../Users/KeycloakClientShould.cs | 20 ++--- 23 files changed, 256 insertions(+), 256 deletions(-) diff --git a/src/Keycloak.Net/Common/Extensions/FlurlRequestExtensions.cs b/src/Keycloak.Net/Common/Extensions/FlurlRequestExtensions.cs index 12e1d09a..e4997d85 100644 --- a/src/Keycloak.Net/Common/Extensions/FlurlRequestExtensions.cs +++ b/src/Keycloak.Net/Common/Extensions/FlurlRequestExtensions.cs @@ -10,17 +10,17 @@ public static class FlurlRequestExtensions { private static async Task GetAccessTokenAsync(string url, string realm, string userName, string password) { - var result = await url - .AppendPathSegment($"/auth/realms/{realm}/protocol/openid-connect/token") - .WithHeader("Accept", "application/json") - .PostUrlEncodedAsync(new List> - { - new KeyValuePair("grant_type", "password"), - new KeyValuePair("username", userName), - new KeyValuePair("password", password), - new KeyValuePair("client_id", "admin-cli") - }) - .ReceiveJson(); + var result = await url + .AppendPathSegment($"/auth/realms/{realm}/protocol/openid-connect/token") + .WithHeader("Accept", "application/json") + .PostUrlEncodedAsync(new List> + { + new KeyValuePair("grant_type", "password"), + new KeyValuePair("username", userName), + new KeyValuePair("password", password), + new KeyValuePair("client_id", "admin-cli") + }) + .ReceiveJson().ConfigureAwait(false); string accessToken = result .access_token.ToString(); diff --git a/src/Keycloak.Net/Users/KeycloakClient.cs b/src/Keycloak.Net/Users/KeycloakClient.cs index 78f62e56..7293eeb5 100644 --- a/src/Keycloak.Net/Users/KeycloakClient.cs +++ b/src/Keycloak.Net/Users/KeycloakClient.cs @@ -13,7 +13,7 @@ public partial class KeycloakClient { public async Task CreateUserAsync(string realm, User user) { - var response = await InternalCreateUserAsync(realm, user); + var response = await InternalCreateUserAsync(realm, user).ConfigureAwait(false); return response.IsSuccessStatusCode; } @@ -24,7 +24,7 @@ private async Task InternalCreateUserAsync(string realm, Us public async Task CreateAndRetrieveUserIdAsync(string realm, User user) { - var response = await InternalCreateUserAsync(realm, user); + var response = await InternalCreateUserAsync(realm, user).ConfigureAwait(false); string locationPathAndQuery = response.Headers.Location.PathAndQuery; string userId = response.IsSuccessStatusCode ? locationPathAndQuery.Substring(locationPathAndQuery.LastIndexOf("/", StringComparison.Ordinal) + 1) : null; return userId; diff --git a/test/Keycloak.Net.Tests/AttackDetection/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/AttackDetection/KeycloakClientShould.cs index e074d38a..336275c2 100644 --- a/test/Keycloak.Net.Tests/AttackDetection/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/AttackDetection/KeycloakClientShould.cs @@ -10,11 +10,11 @@ public partial class KeycloakClientShould [InlineData("Insurance", "vermeulen")] public async Task GetUserNameStatusInBruteForceDetectionAsync(string realm, string search) { - var users = await _client.GetUsersAsync(realm, search: search); + var users = await _client.GetUsersAsync(realm, search: search).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetUserNameStatusInBruteForceDetectionAsync(realm, userId); + var result = await _client.GetUserNameStatusInBruteForceDetectionAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/AuthenticationManagement/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/AuthenticationManagement/KeycloakClientShould.cs index 8511d8a1..e85e69f9 100644 --- a/test/Keycloak.Net.Tests/AuthenticationManagement/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/AuthenticationManagement/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetAuthenticatorProvidersAsync(string realm) { - var result = await _client.GetAuthenticatorProvidersAsync(realm); + var result = await _client.GetAuthenticatorProvidersAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -18,7 +18,7 @@ public async Task GetAuthenticatorProvidersAsync(string realm) [InlineData("Insurance")] public async Task GetClientAuthenticatorProvidersAsync(string realm) { - var result = await _client.GetClientAuthenticatorProvidersAsync(realm); + var result = await _client.GetClientAuthenticatorProvidersAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -26,11 +26,11 @@ public async Task GetClientAuthenticatorProvidersAsync(string realm) [InlineData("Insurance")] public async Task GetAuthenticatorProviderConfigurationDescriptionAsync(string realm) { - var providers = await _client.GetAuthenticatorProvidersAsync(realm); + var providers = await _client.GetAuthenticatorProvidersAsync(realm).ConfigureAwait(false); string providerId = providers.FirstOrDefault()?.FirstOrDefault(x => x.Key == "id").Value.ToString(); if (providerId != null) { - var result = await _client.GetAuthenticatorProviderConfigurationDescriptionAsync(realm, providerId); + var result = await _client.GetAuthenticatorProviderConfigurationDescriptionAsync(realm, providerId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -42,7 +42,7 @@ public async Task GetAuthenticatorConfigurationAsync(string realm) string configurationId = ""; //TODO if (configurationId != null) { - var result = await _client.GetAuthenticatorConfigurationAsync(realm, configurationId); + var result = await _client.GetAuthenticatorConfigurationAsync(realm, configurationId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -51,15 +51,15 @@ public async Task GetAuthenticatorConfigurationAsync(string realm) [InlineData("Insurance")] public async Task GetAuthenticationExecutionAsync(string realm) { - var flows = await _client.GetAuthenticationFlowsAsync(realm); + var flows = await _client.GetAuthenticationFlowsAsync(realm).ConfigureAwait(false); string flowAlias = flows.FirstOrDefault()?.Alias; if (flowAlias != null) { - var executions = await _client.GetAuthenticationFlowExecutionsAsync(realm, flowAlias); + var executions = await _client.GetAuthenticationFlowExecutionsAsync(realm, flowAlias).ConfigureAwait(false); string executionId = executions.FirstOrDefault()?.Id; if (executionId != null) { - var result = await _client.GetAuthenticationExecutionAsync(realm, executionId); + var result = await _client.GetAuthenticationExecutionAsync(realm, executionId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -69,7 +69,7 @@ public async Task GetAuthenticationExecutionAsync(string realm) [InlineData("Insurance")] public async Task GetAuthenticationFlowsAsync(string realm) { - var result = await _client.GetAuthenticationFlowsAsync(realm); + var result = await _client.GetAuthenticationFlowsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -77,11 +77,11 @@ public async Task GetAuthenticationFlowsAsync(string realm) [InlineData("Insurance")] public async Task GetAuthenticationFlowExecutionsAsync(string realm) { - var flows = await _client.GetAuthenticationFlowsAsync(realm); + var flows = await _client.GetAuthenticationFlowsAsync(realm).ConfigureAwait(false); string flowAlias = flows.FirstOrDefault()?.Alias; if (flowAlias != null) { - var result = await _client.GetAuthenticationFlowExecutionsAsync(realm, flowAlias); + var result = await _client.GetAuthenticationFlowExecutionsAsync(realm, flowAlias).ConfigureAwait(false); Assert.NotNull(result); } } @@ -90,11 +90,11 @@ public async Task GetAuthenticationFlowExecutionsAsync(string realm) [InlineData("Insurance")] public async Task GetAuthenticationFlowByIdAsync(string realm) { - var flows = await _client.GetAuthenticationFlowsAsync(realm); + var flows = await _client.GetAuthenticationFlowsAsync(realm).ConfigureAwait(false); string flowId = flows.FirstOrDefault()?.Id; if (flowId != null) { - var result = await _client.GetAuthenticationFlowByIdAsync(realm, flowId); + var result = await _client.GetAuthenticationFlowByIdAsync(realm, flowId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -103,7 +103,7 @@ public async Task GetAuthenticationFlowByIdAsync(string realm) [InlineData("Insurance")] public async Task GetFormActionProvidersAsync(string realm) { - var result = await _client.GetFormActionProvidersAsync(realm); + var result = await _client.GetFormActionProvidersAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -111,7 +111,7 @@ public async Task GetFormActionProvidersAsync(string realm) [InlineData("Insurance")] public async Task GetFormProvidersAsync(string realm) { - var result = await _client.GetFormProvidersAsync(realm); + var result = await _client.GetFormProvidersAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -119,7 +119,7 @@ public async Task GetFormProvidersAsync(string realm) [InlineData("Insurance")] public async Task GetConfigurationDescriptionsForAllClientsAsync(string realm) { - var result = await _client.GetConfigurationDescriptionsForAllClientsAsync(realm); + var result = await _client.GetConfigurationDescriptionsForAllClientsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -127,7 +127,7 @@ public async Task GetConfigurationDescriptionsForAllClientsAsync(string realm) [InlineData("Insurance")] public async Task GetRequiredActionsAsync(string realm) { - var result = await _client.GetRequiredActionsAsync(realm); + var result = await _client.GetRequiredActionsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -135,11 +135,11 @@ public async Task GetRequiredActionsAsync(string realm) [InlineData("Insurance")] public async Task GetRequiredActionByAliasAsync(string realm) { - var requiredActions = await _client.GetRequiredActionsAsync(realm); + var requiredActions = await _client.GetRequiredActionsAsync(realm).ConfigureAwait(false); string requiredActionAlias = requiredActions.FirstOrDefault()?.Alias; if (requiredActionAlias != null) { - var result = await _client.GetRequiredActionByAliasAsync(realm, requiredActionAlias); + var result = await _client.GetRequiredActionByAliasAsync(realm, requiredActionAlias).ConfigureAwait(false); Assert.NotNull(result); } } @@ -148,7 +148,7 @@ public async Task GetRequiredActionByAliasAsync(string realm) [InlineData("Insurance")] public async Task GetUnregisteredRequiredActionsAsync(string realm) { - var result = await _client.GetUnregisteredRequiredActionsAsync(realm); + var result = await _client.GetUnregisteredRequiredActionsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/ClientAttributeCertificate/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/ClientAttributeCertificate/KeycloakClientShould.cs index decaee97..9d6cbc0e 100644 --- a/test/Keycloak.Net.Tests/ClientAttributeCertificate/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/ClientAttributeCertificate/KeycloakClientShould.cs @@ -10,14 +10,14 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetKeyInfoAsync(string realm) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); (string clientId, string attribute) = clients .Where(x => x.Attributes.Any()) .Select(client => (client.Id, client.Attributes.FirstOrDefault().Key)) .FirstOrDefault(); if (clientId != null) { - var result = await _client.GetKeyInfoAsync(realm, clientId, attribute); + var result = await _client.GetKeyInfoAsync(realm, clientId, attribute).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/ClientInitialAccess/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/ClientInitialAccess/KeycloakClientShould.cs index 0205b275..079fa62f 100644 --- a/test/Keycloak.Net.Tests/ClientInitialAccess/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/ClientInitialAccess/KeycloakClientShould.cs @@ -9,7 +9,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetClientInitialAccessAsync(string realm) { - var result = await _client.GetClientInitialAccessAsync(realm); + var result = await _client.GetClientInitialAccessAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/ClientRegistrationPolicy/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/ClientRegistrationPolicy/KeycloakClientShould.cs index 2e48826f..2923e7da 100644 --- a/test/Keycloak.Net.Tests/ClientRegistrationPolicy/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/ClientRegistrationPolicy/KeycloakClientShould.cs @@ -9,7 +9,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetRetrieveProvidersBasePathAsync(string realm) { - var result = await _client.GetRetrieveProvidersBasePathAsync(realm); + var result = await _client.GetRetrieveProvidersBasePathAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/ClientRoleMappings/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/ClientRoleMappings/KeycloakClientShould.cs index 5345643b..341a0588 100644 --- a/test/Keycloak.Net.Tests/ClientRoleMappings/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/ClientRoleMappings/KeycloakClientShould.cs @@ -10,15 +10,15 @@ public partial class KeycloakClientShould [InlineData("Insurance", "insurance-product")] public async Task GetClientRoleMappingsForGroupAsync(string realm, string clientId) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientId != null) { - var result = await _client.GetClientRoleMappingsForGroupAsync(realm, groupId, clientsId); + var result = await _client.GetClientRoleMappingsForGroupAsync(realm, groupId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -28,15 +28,15 @@ public async Task GetClientRoleMappingsForGroupAsync(string realm, string client [InlineData("Insurance", "insurance-product")] public async Task GetAvailableClientRoleMappingsForGroupAsync(string realm, string clientId) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientId != null) { - var result = await _client.GetAvailableClientRoleMappingsForGroupAsync(realm, groupId, clientsId); + var result = await _client.GetAvailableClientRoleMappingsForGroupAsync(realm, groupId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -46,15 +46,15 @@ public async Task GetAvailableClientRoleMappingsForGroupAsync(string realm, stri [InlineData("Insurance", "insurance-product")] public async Task GetEffectiveClientRoleMappingsForGroupAsync(string realm, string clientId) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientId != null) { - var result = await _client.GetEffectiveClientRoleMappingsForGroupAsync(realm, groupId, clientsId); + var result = await _client.GetEffectiveClientRoleMappingsForGroupAsync(realm, groupId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -64,15 +64,15 @@ public async Task GetEffectiveClientRoleMappingsForGroupAsync(string realm, stri [InlineData("Insurance", "insurance-product")] public async Task GetClientRoleMappingsForUserAsync(string realm, string clientId) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientId != null) { - var result = await _client.GetClientRoleMappingsForUserAsync(realm, userId, clientsId); + var result = await _client.GetClientRoleMappingsForUserAsync(realm, userId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -82,15 +82,15 @@ public async Task GetClientRoleMappingsForUserAsync(string realm, string clientI [InlineData("Insurance", "insurance-product")] public async Task GetAvailableClientRoleMappingsForUserAsync(string realm, string clientId) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientId != null) { - var result = await _client.GetAvailableClientRoleMappingsForUserAsync(realm, userId, clientsId); + var result = await _client.GetAvailableClientRoleMappingsForUserAsync(realm, userId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -100,15 +100,15 @@ public async Task GetAvailableClientRoleMappingsForUserAsync(string realm, strin [InlineData("Insurance", "insurance-product")] public async Task GetEffectiveClientRoleMappingsForUserAsync(string realm, string clientId) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientId != null) { - var result = await _client.GetEffectiveClientRoleMappingsForUserAsync(realm, userId, clientsId); + var result = await _client.GetEffectiveClientRoleMappingsForUserAsync(realm, userId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/ClientScopes/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/ClientScopes/KeycloakClientShould.cs index c346891f..e88cf431 100644 --- a/test/Keycloak.Net.Tests/ClientScopes/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/ClientScopes/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetClientScopesAsync(string realm) { - var result = await _client.GetClientScopesAsync(realm); + var result = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -18,11 +18,11 @@ public async Task GetClientScopesAsync(string realm) [InlineData("Insurance")] public async Task GetClientScopeAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var result = await _client.GetClientScopeAsync(realm, clientScopeId); + var result = await _client.GetClientScopeAsync(realm, clientScopeId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/Clients/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/Clients/KeycloakClientShould.cs index fe8c0af7..c64b3352 100644 --- a/test/Keycloak.Net.Tests/Clients/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/Clients/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetClientsAsync(string realm) { - var result = await _client.GetClientsAsync(realm); + var result = await _client.GetClientsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -18,11 +18,11 @@ public async Task GetClientsAsync(string realm) [InlineData("Insurance", "insurance-product")] public async Task GetClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientAsync(realm, clientsId); + var result = await _client.GetClientAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -31,11 +31,11 @@ public async Task GetClientAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GenerateClientSecretAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GenerateClientSecretAsync(realm, clientsId); + var result = await _client.GenerateClientSecretAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -44,11 +44,11 @@ public async Task GenerateClientSecretAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetClientSecretAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientSecretAsync(realm, clientsId); + var result = await _client.GetClientSecretAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -57,11 +57,11 @@ public async Task GetClientSecretAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetDefaultClientScopesAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetDefaultClientScopesAsync(realm, clientsId); + var result = await _client.GetDefaultClientScopesAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -70,11 +70,11 @@ public async Task GetDefaultClientScopesAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GenerateClientExampleAccessTokenAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GenerateClientExampleAccessTokenAsync(realm, clientsId); + var result = await _client.GenerateClientExampleAccessTokenAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -83,11 +83,11 @@ public async Task GenerateClientExampleAccessTokenAsync(string realm, string cli [InlineData("Insurance", "insurance-product")] public async Task GetProtocolMappersInTokenGenerationAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetProtocolMappersInTokenGenerationAsync(realm, clientsId); + var result = await _client.GetProtocolMappersInTokenGenerationAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -96,13 +96,13 @@ public async Task GetProtocolMappersInTokenGenerationAsync(string realm, string [InlineData("Insurance", "insurance-product")] public async Task GetClientGrantedScopeMappingsAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientGrantedScopeMappingsAsync(realm, clientsId, realm); + var result = await _client.GetClientGrantedScopeMappingsAsync(realm, clientsId, realm).ConfigureAwait(false); Assert.NotNull(result); - result = await _client.GetClientGrantedScopeMappingsAsync(realm, clientsId, clientsId); + result = await _client.GetClientGrantedScopeMappingsAsync(realm, clientsId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -111,13 +111,13 @@ public async Task GetClientGrantedScopeMappingsAsync(string realm, string client [InlineData("Insurance", "insurance-product")] public async Task GetClientNotGrantedScopeMappingsAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientNotGrantedScopeMappingsAsync(realm, clientsId, realm); + var result = await _client.GetClientNotGrantedScopeMappingsAsync(realm, clientsId, realm).ConfigureAwait(false); Assert.NotNull(result); - result = await _client.GetClientNotGrantedScopeMappingsAsync(realm, clientsId, clientsId); + result = await _client.GetClientNotGrantedScopeMappingsAsync(realm, clientsId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -126,15 +126,15 @@ public async Task GetClientNotGrantedScopeMappingsAsync(string realm, string cli [InlineData("Insurance", "insurance-product")] public async Task GetClientProviderAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var providerInstances = await _client.GetIdentityProviderInstancesAsync(realm); + var providerInstances = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); string providerInstanceId = providerInstances.FirstOrDefault()?.ProviderId; if (providerInstanceId != null) { - string result = await _client.GetClientProviderAsync(realm, clientsId, providerInstanceId); + string result = await _client.GetClientProviderAsync(realm, clientsId, providerInstanceId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -144,11 +144,11 @@ public async Task GetClientProviderAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetClientAuthorizationPermissionsInitializedAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientAuthorizationPermissionsInitializedAsync(realm, clientsId); + var result = await _client.GetClientAuthorizationPermissionsInitializedAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -157,7 +157,7 @@ public async Task GetClientAuthorizationPermissionsInitializedAsync(string realm [InlineData("Insurance", "insurance-product")] public async Task GetClientOfflineSessionCountAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { @@ -170,11 +170,11 @@ public async Task GetClientOfflineSessionCountAsync(string realm, string clientI [InlineData("Insurance", "insurance-product")] public async Task GetClientOfflineSessionsAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientOfflineSessionsAsync(realm, clientsId); + var result = await _client.GetClientOfflineSessionsAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -183,11 +183,11 @@ public async Task GetClientOfflineSessionsAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetOptionalClientScopesAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetOptionalClientScopesAsync(realm, clientsId); + var result = await _client.GetOptionalClientScopesAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -196,11 +196,11 @@ public async Task GetOptionalClientScopesAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GenerateClientRegistrationAccessTokenAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GenerateClientRegistrationAccessTokenAsync(realm, clientsId); + var result = await _client.GenerateClientRegistrationAccessTokenAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -209,11 +209,11 @@ public async Task GenerateClientRegistrationAccessTokenAsync(string realm, strin [InlineData("Insurance", "insurance-product")] public async Task GetUserForServiceAccountAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetUserForServiceAccountAsync(realm, clientsId); + var result = await _client.GetUserForServiceAccountAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -222,7 +222,7 @@ public async Task GetUserForServiceAccountAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetClientSessionCountAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { @@ -235,11 +235,11 @@ public async Task GetClientSessionCountAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task TestClientClusterNodesAvailableAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.TestClientClusterNodesAvailableAsync(realm, clientsId); + var result = await _client.TestClientClusterNodesAvailableAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -248,11 +248,11 @@ public async Task TestClientClusterNodesAvailableAsync(string realm, string clie [InlineData("Insurance", "insurance-product")] public async Task GetClientUserSessionsAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientUserSessionsAsync(realm, clientsId); + var result = await _client.GetClientUserSessionsAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -261,7 +261,7 @@ public async Task GetClientUserSessionsAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetResourcesOwnedByClientAsync(string realm, string clientId) { - var result = await _client.GetResourcesOwnedByClientAsync(realm, clientId); + var result = await _client.GetResourcesOwnedByClientAsync(realm, clientId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/Components/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/Components/KeycloakClientShould.cs index ec3d3bf6..037b4126 100644 --- a/test/Keycloak.Net.Tests/Components/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/Components/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetComponentsAsync(string realm) { - var result = await _client.GetComponentsAsync(realm); + var result = await _client.GetComponentsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -18,11 +18,11 @@ public async Task GetComponentsAsync(string realm) [InlineData("Insurance")] public async Task GetComponentAsync(string realm) { - var components = await _client.GetComponentsAsync(realm); + var components = await _client.GetComponentsAsync(realm).ConfigureAwait(false); string componentId = components.FirstOrDefault()?.Id; if (componentId != null) { - var result = await _client.GetComponentAsync(realm, componentId); + var result = await _client.GetComponentAsync(realm, componentId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/Groups/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/Groups/KeycloakClientShould.cs index fca31d51..52bb8159 100644 --- a/test/Keycloak.Net.Tests/Groups/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/Groups/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetGroupHierarchyAsync(string realm) { - var result = await _client.GetGroupHierarchyAsync(realm); + var result = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -26,11 +26,11 @@ public async Task GetGroupsCountAsync(string realm) [InlineData("Insurance")] public async Task GetGroupAsync(string realm) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var result = await _client.GetGroupAsync(realm, groupId); + var result = await _client.GetGroupAsync(realm, groupId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -39,11 +39,11 @@ public async Task GetGroupAsync(string realm) [InlineData("Insurance")] public async Task GetGroupClientAuthorizationPermissionsInitializedAsync(string realm) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var result = await _client.GetGroupClientAuthorizationPermissionsInitializedAsync(realm, groupId); + var result = await _client.GetGroupClientAuthorizationPermissionsInitializedAsync(realm, groupId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -52,11 +52,11 @@ public async Task GetGroupClientAuthorizationPermissionsInitializedAsync(string [InlineData("Insurance")] public async Task GetGroupUsersAsync(string realm) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var result = await _client.GetGroupUsersAsync(realm, groupId); + var result = await _client.GetGroupUsersAsync(realm, groupId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/IdentityProviders/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/IdentityProviders/KeycloakClientShould.cs index 64114035..af0491f7 100644 --- a/test/Keycloak.Net.Tests/IdentityProviders/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/IdentityProviders/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetIdentityProviderInstancesAsync(string realm) { - var result = await _client.GetIdentityProviderInstancesAsync(realm); + var result = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -18,11 +18,11 @@ public async Task GetIdentityProviderInstancesAsync(string realm) [InlineData("Insurance")] public async Task GetIdentityProviderAsync(string realm) { - var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm); + var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); string identityProviderAlias = identityProviderInstances.FirstOrDefault()?.Alias; if (identityProviderAlias != null) { - var result = await _client.GetIdentityProviderAsync(realm, identityProviderAlias); + var result = await _client.GetIdentityProviderAsync(realm, identityProviderAlias).ConfigureAwait(false); Assert.NotNull(result); } } @@ -31,11 +31,11 @@ public async Task GetIdentityProviderAsync(string realm) [InlineData("Insurance")] public async Task GetIdentityProviderAuthorizationPermissionsInitializedAsync(string realm) { - var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm); + var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); string identityProviderAlias = identityProviderInstances.FirstOrDefault()?.Alias; if (identityProviderAlias != null) { - var result = await _client.GetIdentityProviderAuthorizationPermissionsInitializedAsync(realm, identityProviderAlias); + var result = await _client.GetIdentityProviderAuthorizationPermissionsInitializedAsync(realm, identityProviderAlias).ConfigureAwait(false); Assert.NotNull(result); } } @@ -44,11 +44,11 @@ public async Task GetIdentityProviderAuthorizationPermissionsInitializedAsync(st [InlineData("Insurance")] public async Task GetIdentityProviderMapperTypesAsync(string realm) { - var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm); + var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); string identityProviderAlias = identityProviderInstances.FirstOrDefault()?.Alias; if (identityProviderAlias != null) { - var result = await _client.GetIdentityProviderMapperTypesAsync(realm, identityProviderAlias); + var result = await _client.GetIdentityProviderMapperTypesAsync(realm, identityProviderAlias).ConfigureAwait(false); Assert.NotNull(result); } } @@ -57,11 +57,11 @@ public async Task GetIdentityProviderMapperTypesAsync(string realm) [InlineData("Insurance")] public async Task GetIdentityProviderMappersAsync(string realm) { - var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm); + var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); string identityProviderAlias = identityProviderInstances.FirstOrDefault()?.Alias; if (identityProviderAlias != null) { - var result = await _client.GetIdentityProviderMappersAsync(realm, identityProviderAlias); + var result = await _client.GetIdentityProviderMappersAsync(realm, identityProviderAlias).ConfigureAwait(false); Assert.NotNull(result); } } @@ -70,15 +70,15 @@ public async Task GetIdentityProviderMappersAsync(string realm) [InlineData("Insurance")] public async Task GetIdentityProviderMapperByIdAsync(string realm) { - var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm); + var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); string identityProviderAlias = identityProviderInstances.FirstOrDefault()?.Alias; if (identityProviderAlias != null) { - var mappers = await _client.GetIdentityProviderMappersAsync(realm, identityProviderAlias); + var mappers = await _client.GetIdentityProviderMappersAsync(realm, identityProviderAlias).ConfigureAwait(false); string mapperId = mappers.FirstOrDefault()?.Id; if (mapperId != null) { - var result = await _client.GetIdentityProviderMapperByIdAsync(realm, identityProviderAlias, mapperId); + var result = await _client.GetIdentityProviderMapperByIdAsync(realm, identityProviderAlias, mapperId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -88,11 +88,11 @@ public async Task GetIdentityProviderMapperByIdAsync(string realm) [InlineData("Insurance")] public async Task GetIdentityProviderByProviderIdAsync(string realm) { - var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm); + var identityProviderInstances = await _client.GetIdentityProviderInstancesAsync(realm).ConfigureAwait(false); string identityProviderId = identityProviderInstances.FirstOrDefault()?.ProviderId; if (identityProviderId != null) { - var result = await _client.GetIdentityProviderByProviderIdAsync(realm, identityProviderId); + var result = await _client.GetIdentityProviderByProviderIdAsync(realm, identityProviderId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/Key/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/Key/KeycloakClientShould.cs index 0b6c82c5..8233f808 100644 --- a/test/Keycloak.Net.Tests/Key/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/Key/KeycloakClientShould.cs @@ -9,7 +9,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetKeysAsync(string realm) { - var result = await _client.GetKeysAsync(realm); + var result = await _client.GetKeysAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/ProtocolMappers/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/ProtocolMappers/KeycloakClientShould.cs index a5634e3a..5daf4ce6 100644 --- a/test/Keycloak.Net.Tests/ProtocolMappers/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/ProtocolMappers/KeycloakClientShould.cs @@ -10,11 +10,11 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetProtocolMappersAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault(x => x.ProtocolMappers != null && x.ProtocolMappers.Any())?.Id; if (clientScopeId != null) { - var result = await _client.GetProtocolMappersAsync(realm, clientScopeId); + var result = await _client.GetProtocolMappersAsync(realm, clientScopeId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -23,15 +23,15 @@ public async Task GetProtocolMappersAsync(string realm) [InlineData("Insurance")] public async Task GetProtocolMapperAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault(x => x.ProtocolMappers != null && x.ProtocolMappers.Any())?.Id; if (clientScopeId != null) { - var protocolMappers = await _client.GetProtocolMappersAsync(realm, clientScopeId); + var protocolMappers = await _client.GetProtocolMappersAsync(realm, clientScopeId).ConfigureAwait(false); string protocolMapperId = protocolMappers.FirstOrDefault()?.Id; if (protocolMapperId != null) { - var result = await _client.GetProtocolMapperAsync(realm, clientScopeId, protocolMapperId); + var result = await _client.GetProtocolMapperAsync(realm, clientScopeId, protocolMapperId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -41,15 +41,15 @@ public async Task GetProtocolMapperAsync(string realm) [InlineData("Insurance")] public async Task GetProtocolMappersByNameAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault(x => x.ProtocolMappers != null && x.ProtocolMappers.Any())?.Id; if (clientScopeId != null) { - var protocolMappers = await _client.GetProtocolMappersAsync(realm, clientScopeId); + var protocolMappers = await _client.GetProtocolMappersAsync(realm, clientScopeId).ConfigureAwait(false); string protocol = protocolMappers.FirstOrDefault()?.Name; if (protocol != null) { - var result = await _client.GetProtocolMappersByNameAsync(realm, clientScopeId, protocol); + var result = await _client.GetProtocolMappersByNameAsync(realm, clientScopeId, protocol).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/RealmsAdmin/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/RealmsAdmin/KeycloakClientShould.cs index fa4d7316..306babca 100644 --- a/test/Keycloak.Net.Tests/RealmsAdmin/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/RealmsAdmin/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetRealmsAsync(string realm) { - var result = await _client.GetRealmsAsync(realm); + var result = await _client.GetRealmsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -18,7 +18,7 @@ public async Task GetRealmsAsync(string realm) [InlineData("Insurance")] public async Task GetRealmAsync(string realm) { - var result = await _client.GetRealmAsync(realm); + var result = await _client.GetRealmAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -26,7 +26,7 @@ public async Task GetRealmAsync(string realm) [InlineData("Insurance")] public async Task GetAdminEventsAsync(string realm) { - var result = await _client.GetAdminEventsAsync(realm); + var result = await _client.GetAdminEventsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -34,7 +34,7 @@ public async Task GetAdminEventsAsync(string realm) [InlineData("Insurance")] public async Task GetClientSessionStatsAsync(string realm) { - var result = await _client.GetClientSessionStatsAsync(realm); + var result = await _client.GetClientSessionStatsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -42,7 +42,7 @@ public async Task GetClientSessionStatsAsync(string realm) [InlineData("Insurance")] public async Task GetRealmDefaultClientScopesAsync(string realm) { - var result = await _client.GetRealmDefaultClientScopesAsync(realm); + var result = await _client.GetRealmDefaultClientScopesAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -50,7 +50,7 @@ public async Task GetRealmDefaultClientScopesAsync(string realm) [InlineData("Insurance")] public async Task GetRealmGroupHierarchyAsync(string realm) { - var result = await _client.GetRealmGroupHierarchyAsync(realm); + var result = await _client.GetRealmGroupHierarchyAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -58,7 +58,7 @@ public async Task GetRealmGroupHierarchyAsync(string realm) [InlineData("Insurance")] public async Task GetRealmOptionalClientScopesAsync(string realm) { - var result = await _client.GetRealmOptionalClientScopesAsync(realm); + var result = await _client.GetRealmOptionalClientScopesAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -66,7 +66,7 @@ public async Task GetRealmOptionalClientScopesAsync(string realm) [InlineData("Insurance")] public async Task GetEventsAsync(string realm) { - var result = await _client.GetEventsAsync(realm); + var result = await _client.GetEventsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -74,7 +74,7 @@ public async Task GetEventsAsync(string realm) [InlineData("Insurance")] public async Task GetRealmEventsProviderConfigurationAsync(string realm) { - var result = await _client.GetRealmEventsProviderConfigurationAsync(realm); + var result = await _client.GetRealmEventsProviderConfigurationAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -82,11 +82,11 @@ public async Task GetRealmEventsProviderConfigurationAsync(string realm) [InlineData("Insurance")] public async Task GetRealmGroupByPathAsync(string realm) { - var groups = await _client.GetRealmGroupHierarchyAsync(realm); + var groups = await _client.GetRealmGroupHierarchyAsync(realm).ConfigureAwait(false); string path = groups.FirstOrDefault()?.Path; if (path != null) { - var result = await _client.GetRealmGroupByPathAsync(realm, path); + var result = await _client.GetRealmGroupByPathAsync(realm, path).ConfigureAwait(false); Assert.NotNull(result); } } @@ -95,7 +95,7 @@ public async Task GetRealmGroupByPathAsync(string realm) [InlineData("Insurance")] public async Task GetRealmUsersManagementPermissionsAsync(string realm) { - var result = await _client.GetRealmUsersManagementPermissionsAsync(realm); + var result = await _client.GetRealmUsersManagementPermissionsAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/RoleMapper/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/RoleMapper/KeycloakClientShould.cs index 24ea6931..e2e6e6c3 100644 --- a/test/Keycloak.Net.Tests/RoleMapper/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/RoleMapper/KeycloakClientShould.cs @@ -10,11 +10,11 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetRoleMappingsForGroupAsync(string realm) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var result = await _client.GetRoleMappingsForGroupAsync(realm, groupId); + var result = await _client.GetRoleMappingsForGroupAsync(realm, groupId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -23,11 +23,11 @@ public async Task GetRoleMappingsForGroupAsync(string realm) [InlineData("Insurance")] public async Task GetRealmRoleMappingsForGroupAsync(string realm) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var result = await _client.GetRealmRoleMappingsForGroupAsync(realm, groupId); + var result = await _client.GetRealmRoleMappingsForGroupAsync(realm, groupId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -36,11 +36,11 @@ public async Task GetRealmRoleMappingsForGroupAsync(string realm) [InlineData("Insurance")] public async Task GetAvailableRealmRoleMappingsForGroupAsync(string realm) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var result = await _client.GetAvailableRealmRoleMappingsForGroupAsync(realm, groupId); + var result = await _client.GetAvailableRealmRoleMappingsForGroupAsync(realm, groupId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -49,11 +49,11 @@ public async Task GetAvailableRealmRoleMappingsForGroupAsync(string realm) [InlineData("Insurance")] public async Task GetEffectiveRealmRoleMappingsForGroupAsync(string realm) { - var groups = await _client.GetGroupHierarchyAsync(realm); + var groups = await _client.GetGroupHierarchyAsync(realm).ConfigureAwait(false); string groupId = groups.FirstOrDefault()?.Id; if (groupId != null) { - var result = await _client.GetEffectiveRealmRoleMappingsForGroupAsync(realm, groupId); + var result = await _client.GetEffectiveRealmRoleMappingsForGroupAsync(realm, groupId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -62,11 +62,11 @@ public async Task GetEffectiveRealmRoleMappingsForGroupAsync(string realm) [InlineData("Insurance")] public async Task GetRoleMappingsForUserAsync(string realm) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetRoleMappingsForUserAsync(realm, userId); + var result = await _client.GetRoleMappingsForUserAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -75,11 +75,11 @@ public async Task GetRoleMappingsForUserAsync(string realm) [InlineData("Insurance")] public async Task GetRealmRoleMappingsForUserAsync(string realm) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetRealmRoleMappingsForUserAsync(realm, userId); + var result = await _client.GetRealmRoleMappingsForUserAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -88,11 +88,11 @@ public async Task GetRealmRoleMappingsForUserAsync(string realm) [InlineData("Insurance")] public async Task GetAvailableRealmRoleMappingsForUserAsync(string realm) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetAvailableRealmRoleMappingsForUserAsync(realm, userId); + var result = await _client.GetAvailableRealmRoleMappingsForUserAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -101,11 +101,11 @@ public async Task GetAvailableRealmRoleMappingsForUserAsync(string realm) [InlineData("Insurance")] public async Task GetEffectiveRealmRoleMappingsForUserAsync(string realm) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetEffectiveRealmRoleMappingsForUserAsync(realm, userId); + var result = await _client.GetEffectiveRealmRoleMappingsForUserAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/Roles/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/Roles/KeycloakClientShould.cs index f4b105b7..65643ea9 100644 --- a/test/Keycloak.Net.Tests/Roles/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/Roles/KeycloakClientShould.cs @@ -10,11 +10,11 @@ public partial class KeycloakClientShould [InlineData("Insurance", "insurance-product")] public async Task GetRolesForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetRolesAsync(realm, clientsId); + var result = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -23,15 +23,15 @@ public async Task GetRolesForClientAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetRoleByNameForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm, clientsId); + var roles = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRoleByNameAsync(realm, clientsId, roleName); + var result = await _client.GetRoleByNameAsync(realm, clientsId, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -41,15 +41,15 @@ public async Task GetRoleByNameForClientAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetRoleCompositesForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm, clientsId); + var roles = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRoleCompositesAsync(realm, clientsId, roleName); + var result = await _client.GetRoleCompositesAsync(realm, clientsId, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -59,15 +59,15 @@ public async Task GetRoleCompositesForClientAsync(string realm, string clientId) [InlineData("Insurance", "insurance-product")] public async Task GetApplicationRolesForCompositeForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm, clientsId); + var roles = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetApplicationRolesForCompositeAsync(realm, clientsId, roleName, clientsId); + var result = await _client.GetApplicationRolesForCompositeAsync(realm, clientsId, roleName, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -77,15 +77,15 @@ public async Task GetApplicationRolesForCompositeForClientAsync(string realm, st [InlineData("Insurance", "insurance-product")] public async Task GetRealmRolesForCompositeForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm, clientsId); + var roles = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRealmRolesForCompositeAsync(realm, clientsId, roleName); + var result = await _client.GetRealmRolesForCompositeAsync(realm, clientsId, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -95,15 +95,15 @@ public async Task GetRealmRolesForCompositeForClientAsync(string realm, string c [InlineData("Insurance", "insurance-product")] public async Task GetGroupsWithRoleNameForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm, clientsId); + var roles = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetGroupsWithRoleNameAsync(realm, clientsId, roleName); + var result = await _client.GetGroupsWithRoleNameAsync(realm, clientsId, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -113,15 +113,15 @@ public async Task GetGroupsWithRoleNameForClientAsync(string realm, string clien [InlineData("Insurance", "insurance-product")] public async Task GetRoleAuthorizationPermissionsInitializedForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm, clientsId); + var roles = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRoleAuthorizationPermissionsInitializedAsync(realm, clientsId, roleName); + var result = await _client.GetRoleAuthorizationPermissionsInitializedAsync(realm, clientsId, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -131,15 +131,15 @@ public async Task GetRoleAuthorizationPermissionsInitializedForClientAsync(strin [InlineData("Insurance", "insurance-product")] public async Task GetUsersWithRoleNameForClientAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm, clientsId); + var roles = await _client.GetRolesAsync(realm, clientsId).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetUsersWithRoleNameAsync(realm, clientsId, roleName); + var result = await _client.GetUsersWithRoleNameAsync(realm, clientsId, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -149,7 +149,7 @@ public async Task GetUsersWithRoleNameForClientAsync(string realm, string client [InlineData("Insurance")] public async Task GetRolesForRealmAsync(string realm) { - var result = await _client.GetRolesAsync(realm); + var result = await _client.GetRolesAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -157,11 +157,11 @@ public async Task GetRolesForRealmAsync(string realm) [InlineData("Insurance")] public async Task GetRoleByNameForRealmAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRoleByNameAsync(realm, roleName); + var result = await _client.GetRoleByNameAsync(realm, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -170,11 +170,11 @@ public async Task GetRoleByNameForRealmAsync(string realm) [InlineData("Insurance")] public async Task GetRoleCompositesForRealmAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRoleCompositesAsync(realm, roleName); + var result = await _client.GetRoleCompositesAsync(realm, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -183,15 +183,15 @@ public async Task GetRoleCompositesForRealmAsync(string realm) [InlineData("Insurance", "insurance-product")] public async Task GetApplicationRolesForCompositeForRealmAsync(string realm, string clientId) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetApplicationRolesForCompositeAsync(realm, roleName, clientsId); + var result = await _client.GetApplicationRolesForCompositeAsync(realm, roleName, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -201,11 +201,11 @@ public async Task GetApplicationRolesForCompositeForRealmAsync(string realm, str [InlineData("Insurance")] public async Task GetRealmRolesForCompositeForRealmAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRealmRolesForCompositeAsync(realm, roleName); + var result = await _client.GetRealmRolesForCompositeAsync(realm, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -214,11 +214,11 @@ public async Task GetRealmRolesForCompositeForRealmAsync(string realm) [InlineData("Insurance")] public async Task GetGroupsWithRoleNameForRealmAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetGroupsWithRoleNameAsync(realm, roleName); + var result = await _client.GetGroupsWithRoleNameAsync(realm, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -227,11 +227,11 @@ public async Task GetGroupsWithRoleNameForRealmAsync(string realm) [InlineData("Insurance")] public async Task GetRoleAuthorizationPermissionsInitializedForRealmAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetRoleAuthorizationPermissionsInitializedAsync(realm, roleName); + var result = await _client.GetRoleAuthorizationPermissionsInitializedAsync(realm, roleName).ConfigureAwait(false); Assert.NotNull(result); } } @@ -240,11 +240,11 @@ public async Task GetRoleAuthorizationPermissionsInitializedForRealmAsync(string [InlineData("Insurance")] public async Task GetUsersWithRoleNameForRealmAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleName = roles.FirstOrDefault()?.Name; if (roleName != null) { - var result = await _client.GetUsersWithRoleNameAsync(realm, roleName); + var result = await _client.GetUsersWithRoleNameAsync(realm, roleName).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/RolesById/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/RolesById/KeycloakClientShould.cs index 8ecbf5f0..c0cdc109 100644 --- a/test/Keycloak.Net.Tests/RolesById/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/RolesById/KeycloakClientShould.cs @@ -10,11 +10,11 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetRoleByIdAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleId = roles.FirstOrDefault()?.Id; if (roleId != null) { - var result = await _client.GetRoleByIdAsync(realm, roleId); + var result = await _client.GetRoleByIdAsync(realm, roleId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -23,11 +23,11 @@ public async Task GetRoleByIdAsync(string realm) [InlineData("Insurance")] public async Task GetRoleChildrenAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleId = roles.FirstOrDefault()?.Id; if (roleId != null) { - var result = await _client.GetRoleChildrenAsync(realm, roleId); + var result = await _client.GetRoleChildrenAsync(realm, roleId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -36,15 +36,15 @@ public async Task GetRoleChildrenAsync(string realm) [InlineData("Insurance", "insurance-product")] public async Task GetClientRolesForCompositeByIdAsync(string realm, string clientId) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleId = roles.FirstOrDefault()?.Id; if (roleId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientsId = clients.FirstOrDefault(x => x.ClientId == clientId)?.Id; if (clientsId != null) { - var result = await _client.GetClientRolesForCompositeByIdAsync(realm, roleId, clientsId); + var result = await _client.GetClientRolesForCompositeByIdAsync(realm, roleId, clientsId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -54,11 +54,11 @@ public async Task GetClientRolesForCompositeByIdAsync(string realm, string clien [InlineData("Insurance")] public async Task GetRealmRolesForCompositeByIdAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleId = roles.FirstOrDefault()?.Id; if (roleId != null) { - var result = await _client.GetRealmRolesForCompositeByIdAsync(realm, roleId); + var result = await _client.GetRealmRolesForCompositeByIdAsync(realm, roleId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -67,11 +67,11 @@ public async Task GetRealmRolesForCompositeByIdAsync(string realm) [InlineData("Insurance")] public async Task GetRoleByIdAuthorizationPermissionsInitializedAsync(string realm) { - var roles = await _client.GetRolesAsync(realm); + var roles = await _client.GetRolesAsync(realm).ConfigureAwait(false); string roleId = roles.FirstOrDefault()?.Id; if (roleId != null) { - var result = await _client.GetRoleByIdAuthorizationPermissionsInitializedAsync(realm, roleId); + var result = await _client.GetRoleByIdAuthorizationPermissionsInitializedAsync(realm, roleId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/Root/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/Root/KeycloakClientShould.cs index 45d1bea4..e3ce7af8 100644 --- a/test/Keycloak.Net.Tests/Root/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/Root/KeycloakClientShould.cs @@ -9,7 +9,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetServerInfoAsync(string realm) { - var result = await _client.GetServerInfoAsync(realm); + var result = await _client.GetServerInfoAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } diff --git a/test/Keycloak.Net.Tests/ScopeMappings/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/ScopeMappings/KeycloakClientShould.cs index fe1cbbb3..bc64c9c8 100644 --- a/test/Keycloak.Net.Tests/ScopeMappings/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/ScopeMappings/KeycloakClientShould.cs @@ -10,11 +10,11 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetScopeMappingsAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var result = await _client.GetScopeMappingsAsync(realm, clientScopeId); + var result = await _client.GetScopeMappingsAsync(realm, clientScopeId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -23,15 +23,15 @@ public async Task GetScopeMappingsAsync(string realm) [InlineData("Insurance")] public async Task GetClientRolesForClientScopeAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetClientRolesForClientScopeAsync(realm, clientScopeId, clientId); + var result = await _client.GetClientRolesForClientScopeAsync(realm, clientScopeId, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -41,15 +41,15 @@ public async Task GetClientRolesForClientScopeAsync(string realm) [InlineData("Insurance")] public async Task GetAvailableClientRolesForClientScopeAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetAvailableClientRolesForClientScopeAsync(realm, clientScopeId, clientId); + var result = await _client.GetAvailableClientRolesForClientScopeAsync(realm, clientScopeId, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -59,15 +59,15 @@ public async Task GetAvailableClientRolesForClientScopeAsync(string realm) [InlineData("Insurance")] public async Task GetEffectiveClientRolesForClientScopeAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetEffectiveClientRolesForClientScopeAsync(realm, clientScopeId, clientId); + var result = await _client.GetEffectiveClientRolesForClientScopeAsync(realm, clientScopeId, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -77,11 +77,11 @@ public async Task GetEffectiveClientRolesForClientScopeAsync(string realm) [InlineData("Insurance")] public async Task GetRealmRolesForClientScopeAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var result = await _client.GetRealmRolesForClientScopeAsync(realm, clientScopeId); + var result = await _client.GetRealmRolesForClientScopeAsync(realm, clientScopeId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -90,11 +90,11 @@ public async Task GetRealmRolesForClientScopeAsync(string realm) [InlineData("Insurance")] public async Task GetAvailableRealmRolesForClientScopeAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var result = await _client.GetAvailableRealmRolesForClientScopeAsync(realm, clientScopeId); + var result = await _client.GetAvailableRealmRolesForClientScopeAsync(realm, clientScopeId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -103,11 +103,11 @@ public async Task GetAvailableRealmRolesForClientScopeAsync(string realm) [InlineData("Insurance")] public async Task GetEffectiveRealmRolesForClientScopeAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var result = await _client.GetEffectiveRealmRolesForClientScopeAsync(realm, clientScopeId); + var result = await _client.GetEffectiveRealmRolesForClientScopeAsync(realm, clientScopeId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -116,11 +116,11 @@ public async Task GetEffectiveRealmRolesForClientScopeAsync(string realm) [InlineData("Insurance")] public async Task GetScopeMappingsForClientAsync(string realm) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetScopeMappingsForClientAsync(realm, clientId); + var result = await _client.GetScopeMappingsForClientAsync(realm, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -129,11 +129,11 @@ public async Task GetScopeMappingsForClientAsync(string realm) [InlineData("Insurance")] public async Task GetClientRolesScopeMappingsForClientAsync(string realm) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetClientRolesScopeMappingsForClientAsync(realm, clientId); + var result = await _client.GetClientRolesScopeMappingsForClientAsync(realm, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -142,15 +142,15 @@ public async Task GetClientRolesScopeMappingsForClientAsync(string realm) [InlineData("Insurance")] public async Task GetAvailableClientRolesForClientScopeForClientAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetAvailableClientRolesForClientScopeForClientAsync(realm, clientScopeId, clientId); + var result = await _client.GetAvailableClientRolesForClientScopeForClientAsync(realm, clientScopeId, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -160,15 +160,15 @@ public async Task GetAvailableClientRolesForClientScopeForClientAsync(string rea [InlineData("Insurance")] public async Task GetEffectiveClientRolesForClientScopeForClientAsync(string realm) { - var clientScopes = await _client.GetClientScopesAsync(realm); + var clientScopes = await _client.GetClientScopesAsync(realm).ConfigureAwait(false); string clientScopeId = clientScopes.FirstOrDefault()?.Id; if (clientScopeId != null) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetEffectiveClientRolesForClientScopeForClientAsync(realm, clientScopeId, clientId); + var result = await _client.GetEffectiveClientRolesForClientScopeForClientAsync(realm, clientScopeId, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -178,11 +178,11 @@ public async Task GetEffectiveClientRolesForClientScopeForClientAsync(string rea [InlineData("Insurance")] public async Task GetRealmRolesScopeMappingsForClientAsync(string realm) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetRealmRolesScopeMappingsForClientAsync(realm, clientId); + var result = await _client.GetRealmRolesScopeMappingsForClientAsync(realm, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -191,11 +191,11 @@ public async Task GetRealmRolesScopeMappingsForClientAsync(string realm) [InlineData("Insurance")] public async Task GetAvailableRealmRolesForClientScopeForClientAsync(string realm) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetAvailableRealmRolesForClientScopeForClientAsync(realm, clientId); + var result = await _client.GetAvailableRealmRolesForClientScopeForClientAsync(realm, clientId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -204,11 +204,11 @@ public async Task GetAvailableRealmRolesForClientScopeForClientAsync(string real [InlineData("Insurance")] public async Task GetEffectiveRealmRolesForClientScopeForClientAsync(string realm) { - var clients = await _client.GetClientsAsync(realm); + var clients = await _client.GetClientsAsync(realm).ConfigureAwait(false); string clientId = clients.FirstOrDefault()?.Id; if (clientId != null) { - var result = await _client.GetEffectiveRealmRolesForClientScopeForClientAsync(realm, clientId); + var result = await _client.GetEffectiveRealmRolesForClientScopeForClientAsync(realm, clientId).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/UserStorageProvider/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/UserStorageProvider/KeycloakClientShould.cs index 037e5838..5e782388 100644 --- a/test/Keycloak.Net.Tests/UserStorageProvider/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/UserStorageProvider/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould public async Task TriggerUserSynchronizationAsync(string realm) { string storageProviderId = ""; - var result = await _client.TriggerUserSynchronizationAsync(realm, storageProviderId, UserSyncActions.Full); + var result = await _client.TriggerUserSynchronizationAsync(realm, storageProviderId, UserSyncActions.Full).ConfigureAwait(false); Assert.NotNull(result); } @@ -20,7 +20,7 @@ public async Task TriggerLdapMapperSynchronizationAsync(string realm) { string storageProviderId = ""; string mapperId = ""; - var result = await _client.TriggerLdapMapperSynchronizationAsync(realm, storageProviderId, mapperId, LdapMapperSyncActions.KeycloakToFed); + var result = await _client.TriggerLdapMapperSynchronizationAsync(realm, storageProviderId, mapperId, LdapMapperSyncActions.KeycloakToFed).ConfigureAwait(false); Assert.NotNull(result); } } diff --git a/test/Keycloak.Net.Tests/Users/KeycloakClientShould.cs b/test/Keycloak.Net.Tests/Users/KeycloakClientShould.cs index c5f8455e..329b4863 100644 --- a/test/Keycloak.Net.Tests/Users/KeycloakClientShould.cs +++ b/test/Keycloak.Net.Tests/Users/KeycloakClientShould.cs @@ -10,7 +10,7 @@ public partial class KeycloakClientShould [InlineData("Insurance")] public async Task GetUsersAsync(string realm) { - var result = await _client.GetUsersAsync(realm); + var result = await _client.GetUsersAsync(realm).ConfigureAwait(false); Assert.NotNull(result); } @@ -26,11 +26,11 @@ public async Task GetUsersCountAsync(string realm) [InlineData("Insurance")] public async Task GetUserAsync(string realm) { - var users = await _client.GetUsersAsync(realm); + var users = await _client.GetUsersAsync(realm).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetUserAsync(realm, userId); + var result = await _client.GetUserAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); Assert.Equal(userId, result.Id); } @@ -40,11 +40,11 @@ public async Task GetUserAsync(string realm) [InlineData("Insurance", "vermeulen")] public async Task GetUserSocialLoginsAsync(string realm, string search) { - var users = await _client.GetUsersAsync(realm, search: search); + var users = await _client.GetUsersAsync(realm, search: search).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetUserSocialLoginsAsync(realm, userId); + var result = await _client.GetUserSocialLoginsAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -53,11 +53,11 @@ public async Task GetUserSocialLoginsAsync(string realm, string search) [InlineData("Insurance", "vermeulen")] public async Task GetUserGroupsAsync(string realm, string search) { - var users = await _client.GetUsersAsync(realm, search: search); + var users = await _client.GetUsersAsync(realm, search: search).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetUserGroupsAsync(realm, userId); + var result = await _client.GetUserGroupsAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } } @@ -66,7 +66,7 @@ public async Task GetUserGroupsAsync(string realm, string search) [InlineData("Insurance", "vermeulen")] public async Task GetUserGroupsCountAsync(string realm, string search) { - var users = await _client.GetUsersAsync(realm, search: search); + var users = await _client.GetUsersAsync(realm, search: search).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { @@ -79,11 +79,11 @@ public async Task GetUserGroupsCountAsync(string realm, string search) [InlineData("Insurance", "vermeulen")] public async Task GetUserSessionsAsync(string realm, string search) { - var users = await _client.GetUsersAsync(realm, search: search); + var users = await _client.GetUsersAsync(realm, search: search).ConfigureAwait(false); string userId = users.FirstOrDefault()?.Id; if (userId != null) { - var result = await _client.GetUserSessionsAsync(realm, userId); + var result = await _client.GetUserSessionsAsync(realm, userId).ConfigureAwait(false); Assert.NotNull(result); } }