mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-09 05:25:15 +00:00
refactor: Replace interface{} with any and add comprehensive plugin service tests with benchmarks
- Replace interface{} with any in sendDeactivationRequest method signature in es2_helpers.go
- Add plugin_service_test.go with setupPluginTest helper using in-memory SQLite and gorm.AutoMigrate
- Add TestPluginService_List with test cases for all/enabled/disabled/by-type filtering and no matches
- Add TestPluginService_Install with tests for successful install, duplicate prevention, and missing fields
This commit is contained in:
@@ -39,7 +39,7 @@ func (e *ES2Service) sendActivationRequest(ctx context.Context, req ActivationRe
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *ES2Service) sendDeactivationRequest(ctx context.Context, req interface{}) error {
|
||||
func (e *ES2Service) sendDeactivationRequest(ctx context.Context, req any) error {
|
||||
jsonData, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to marshal deactivation request: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user