| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This directory contains the comprehensive test suite for the NETCore.Keycloak.Client library. The test suite is designed to validate the library's functionality across multiple versions of Keycloak (20.x through 26.x) using automated test environments and continuous integration.
The test suite implements:
Key features of the test infrastructure:
Python Environment:
Docker:
.NET SDK:
Build Tools:
The project uses a Makefile to automate the Python environment setup. The following commands are available:
# Install virtual environment and dependencies
make install_virtual_env
# This will:
# 1. Create a Python virtual environment (keycloak.venv)
# 2. Install required Python packages from requirements.txt
# 3. Install necessary Ansible collections:
# - community.general
# - community.postgresql
# - community.crypto
# - community.dockerThe test suite uses Cake for build automation and includes several types of tests:
# Run tests for a specific Keycloak version (replace XX with version 20-26)
dotnet cake e2e_test.cake --kc_major_version=XX
# Run tests for all supported Keycloak versions
dotnet cake e2e_test.cakeClean:
Restore:
Build:
Test:
E2E-Tests:
Authentication Tests (KcAuthTests/):
Authentication Configuration (KcAuthentication/):
Authorization Tests (KcAuthorizationTests/):
Client Management (KcClientsTests/):
Client Scope Tests (KcClientScopeTests/):
Group Management (KcGroupTests/):
Support Tests:
Each test module follows these patterns:
Happy Path Tests:
Error Case Tests:
Filter Tests:
Integration Tests:
The MockData/ directory provides test fixtures:
Authentication Mocks:
Resource Mocks:
Entity Mocks:
NETCore.Keycloak.Client.Tests/ ├── Abstraction/ # Test abstractions and base classes │ ├── KcTestableBearerAuthorizationHandler.cs │ └── KcTestingModule.cs ├── ExceptionsTests/ # Exception handling tests │ ├── KcExceptionTests.cs │ ├── KcSessionClosedExceptionTests.cs │ └── KcUserNotFoundExceptionTests.cs ├── MockData/ # Mock data and test helpers │ ├── KcClientMocks.cs │ ├── KcJwtTokenMock.cs │ ├── KcProtocolMapperMocks.cs │ ├── KcRoleMocks.cs │ └── KcUserMocks.cs ├── Models/ # Test model definitions │ ├── KcTestEnvironment.cs │ ├── KcTestRealm.cs │ ├── KcTestResource.cs │ └── KcTestUser.cs ├── Modules/ # Feature module tests │ ├── KcAuthTests/ # Authentication tests │ │ ├── KcAuthClientCredentialsTests.cs │ │ ├── KcAuthRefreshAccessTokenTests.cs │ │ ├── KcAuthRequestPartyToken.cs │ │ └── KcAuthResourceOwnerPasswordTests.cs │ ├── KcAuthentication/ # Authentication configuration tests │ │ ├── KcAuthenticationConfigurationTests.cs │ │ ├── KcAuthenticationExtensionTests.cs │ │ └── KcRolesClaimsTransformerTests.cs │ ├── KcAuthorizationTests/ # Authorization handler tests │ │ ├── KcAuthorizationExtensionTests.cs │ │ ├── KcBearerAuthorizationHandlerTests.cs │ │ ├── KcProtectedResourcePolicyProviderTests.cs │ │ └── KcRealmAdminConfigurationTests.cs │ ├── KcClientScopeTests/ # Client scope tests │ │ └── KcClientScopeHappyPathTests.cs │ ├── KcClientsTests/ # Client management tests │ │ ├── KcClientFilterTests.cs │ │ ├── KcClientHappyPathTests.cs │ │ ├── KcClientServiceAccountTests.cs │ │ └── KcClientTokenTests.cs │ └── KcGroupTests/ # Group management tests │ ├── KcGroupFilterTests.cs │ └── KcGroupsHappyPathTests.cs ├── ansible/ # Environment automation ├── cakeScripts/ # Build automation scripts ├── e2e_test.cake # E2E test orchestration
The Makefile automates several key aspects of the test environment:
install_virtual_env:
# Creates/recreates Python virtual environment
# Installs Python dependencies
# Installs required Ansible collectionsstop:
# Stops and removes the current Keycloak environment
# Cleans up containers and volumes| Back | FazBrowse Home | New Git URL |