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:
nutcas3
2026-04-20 20:08:23 +03:00
parent f42a753372
commit f8d218448d
4 changed files with 265 additions and 13 deletions
@@ -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)