This branch introduces comprehensive unit tests for:
- New SBOM (Software Bill of Materials) functionality
- Java 25 migration validation
- Enhanced ETL service testing
- Dependency version validation
.github/workflows/sbom.yml- GitHub Actions workflow for generating CycloneDX SBOMdocs/sbom.md- Documentation for SBOM generation
pom.xml- Java version updated from 17 to 25, added PostgreSQL and Spring Kafka version managementcdc-service/pom.xml- Debezium upgraded from 2.3.x to 3.4.0.Final- Multiple documentation files - Java version references updated to 25
38 new test methods validate:
- GitHub Actions workflow syntax and structure
- Proper Java 25 configuration
- CycloneDX plugin configuration
- Maven caching and batch mode
- Artifact upload configuration
- Documentation completeness
- Cross-file version consistency
50+ test methods covering:
- All data transformation scenarios
- Edge cases (empty strings, Unicode, large values)
- Error handling (invalid JSON, database failures)
- Parallel processing
- SQL injection prevention
- Retry mechanism validation
- Ensures supply chain security through proper SBOM generation
- Validates CI/CD pipeline configuration
- Catches configuration errors early
- Ensures compatibility with Java 25
- Validates critical data transformation logic
- Ensures data quality and consistency
- Catches edge cases that could cause production issues
- Validates security best practices
- Tests parallel processing correctness
- Ensures consistent Java 25 usage across the project
- Validates dependency version compatibility
- Catches documentation inconsistencies
- Ensures smooth migration path
# Run all tests
mvn clean test
# Run only documentation validation tests
mvn test -Dtest=DocumentationValidationTest
# Run only ETL service tests
mvn test -Dtest=EtlServiceTest
# Run with verbose output
mvn test -X
# Generate coverage report
mvn test jacoco:reportAll tests should pass, validating: ✅ SBOM workflow is correctly configured for Java 25 ✅ SBOM documentation is complete and accurate ✅ All documentation references Java 25 consistently ✅ Debezium 3.4.0.Final is used consistently ✅ ETL service handles all data transformation scenarios ✅ Error handling works correctly ✅ No SQL injection vulnerabilities
-
SBOM Workflow Tests - Update when:
- Changing Java version
- Modifying CycloneDX plugin version
- Changing workflow triggers or permissions
- Adding new build steps
-
ETL Service Tests - Update when:
- Modifying data transformation logic
- Adding new fields or data types
- Changing error handling behavior
- Modifying database interactions
-
Version Consistency Tests - Update when:
- Upgrading Java version
- Updating major dependencies
- Adding new documentation files
When adding features, ensure:
- Happy path is tested
- Edge cases are covered
- Error conditions are validated
- Documentation is updated
- Cross-cutting concerns (security, performance) are tested
These tests will run automatically on:
- Pull requests
- Pushes to main
- Before merges
Failed tests will block merges, ensuring code quality.
- Tests execute quickly using mocking
- No external dependencies required
- Can run in isolated environments
- Tests validate parameterized queries (SQL injection prevention)
- Tests ensure proper error handling (no information leakage)
- Workflow tests validate secure defaults
- Tests are well-organized using nested classes
- Each test has clear, descriptive names
- Tests are independent and can run in any order
-
SBOM Workflow Tests Fail
- Check
.github/workflows/sbom.ymlsyntax - Verify Java version is set to 25
- Ensure CycloneDX plugin version is correct
- Check
-
Version Consistency Tests Fail
- Update all documentation files to reference Java 25
- Ensure no legacy version references remain
- Check POM files for correct versions
-
ETL Service Tests Fail
- Verify service implementation matches test expectations
- Check for changes in transformation logic
- Ensure mocking setup is correct
- Review test failure messages carefully
- Check test logs for detailed error information
- Review the actual implementation against test expectations
- Consult the test generation summary for context
These tests provide comprehensive coverage of the branch changes, ensuring:
- New SBOM functionality works correctly
- Java 25 migration is complete and consistent
- ETL service is robust and secure
- Dependencies are properly managed
The tests follow best practices and integrate seamlessly with the existing test infrastructure.