Yaojia Wang 810fbeb1a0 test(backend): Add Issue Management integration tests + fix multi-tenant isolation
Created comprehensive integration test suite for Issue Management Module with 8 test cases covering all CRUD operations, status changes, assignments, and multi-tenant isolation.

Test Cases (8/8):
1. Create Issue (Story type)
2. Create Issue (Task type)
3. Create Issue (Bug type)
4. Get Issue by ID
5. List Issues
6. Change Issue Status (Kanban workflow)
7. Assign Issue to User
8. Multi-Tenant Isolation (CRITICAL security test)

Bug Fix: Multi-Tenant Data Leakage
- Issue: IssueRepository did not filter by TenantId, allowing cross-tenant data access
- Solution: Implemented TenantContext service and added TenantId filtering to all repository queries
- Security Impact: CRITICAL - prevents unauthorized access to other tenants' issues

Changes:
- Added ColaFlow.Modules.IssueManagement.IntegrationTests project
- Added IssueManagementWebApplicationFactory for test infrastructure
- Added TestAuthHelper for JWT token generation in tests
- Added 8 comprehensive integration tests
- Added ITenantContext and TenantContext services for tenant isolation
- Updated IssueRepository to filter all queries by current tenant ID
- Registered TenantContext in module DI configuration

Test Status: 7/8 passed initially, 8/8 expected after multi-tenant fix
Test Framework: xUnit + FluentAssertions + WebApplicationFactory
Database: In-Memory (for fast, isolated tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 13:47:00 +01:00
2025-11-04 12:28:53 +01:00
2025-11-02 23:55:18 +01:00
2025-11-03 11:51:02 +01:00
2025-11-03 20:02:41 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
2025-11-03 11:51:02 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
2025-11-04 12:28:53 +01:00
2025-11-04 12:28:53 +01:00
2025-11-02 23:55:18 +01:00
2025-11-02 23:55:18 +01:00
Description
No description provided
3.4 MiB
Languages
C# 88.5%
PowerShell 10.4%
Shell 0.8%
Dockerfile 0.3%