88)
99
1010func TestNewUnifiedClassificationService (t * testing.T ) {
11- // Test with nil unified classifier (this is expected to work)
11+ // Test with nil unified classifier and nil legacy classifier (this is expected to work)
1212 config := & config.RouterConfig {}
13- service := NewUnifiedClassificationService (nil , config )
13+ service := NewUnifiedClassificationService (nil , nil , config )
1414
1515 if service == nil {
1616 t .Error ("Expected non-nil service" )
@@ -26,6 +26,28 @@ func TestNewUnifiedClassificationService(t *testing.T) {
2626 }
2727}
2828
29+ func TestNewUnifiedClassificationService_WithBothClassifiers (t * testing.T ) {
30+ // Test with both unified and legacy classifiers
31+ config := & config.RouterConfig {}
32+ unifiedClassifier := & classification.UnifiedClassifier {}
33+ legacyClassifier := & classification.Classifier {}
34+
35+ service := NewUnifiedClassificationService (unifiedClassifier , legacyClassifier , config )
36+
37+ if service == nil {
38+ t .Error ("Expected non-nil service" )
39+ }
40+ if service .classifier != legacyClassifier {
41+ t .Error ("Expected legacy classifier to match provided classifier" )
42+ }
43+ if service .unifiedClassifier != unifiedClassifier {
44+ t .Error ("Expected unified classifier to match provided classifier" )
45+ }
46+ if service .config != config {
47+ t .Error ("Expected config to match" )
48+ }
49+ }
50+
2951func TestClassificationService_HasUnifiedClassifier (t * testing.T ) {
3052 t .Run ("No_classifier" , func (t * testing.T ) {
3153 service := & ClassificationService {
0 commit comments