diff --git a/provider/resource_keycloak_realm_events_test.go b/provider/resource_keycloak_realm_events_test.go index 39f722b57..38ebac94f 100644 --- a/provider/resource_keycloak_realm_events_test.go +++ b/provider/resource_keycloak_realm_events_test.go @@ -165,7 +165,15 @@ func TestAccKeycloakRealmEvents_unsetEnabledEventTypes(t *testing.T) { } //keycloak versions < 7.0.0 have 63 events, versions >=7.0.0 have 67 events, versions >=12.0.0 have 69 events - if ok, _ := keycloakClient.VersionIsGreaterThanOrEqualTo(testCtx, keycloak.Version_14); ok { + if ok, _ := keycloakClient.VersionIsGreaterThanOrEqualTo(testCtx, keycloak.Version_24); ok { + if len(realmEventsConfig.EnabledEventTypes) != 83 { + return fmt.Errorf("exptected to enabled_event_types to contain all(83) event types, but it contains %d", len(realmEventsConfig.EnabledEventTypes)) + } + } else if ok, _ := keycloakClient.VersionIsGreaterThanOrEqualTo(testCtx, keycloak.Version_23); ok { + if len(realmEventsConfig.EnabledEventTypes) != 80 { + return fmt.Errorf("exptected to enabled_event_types to contain all(80) event types, but it contains %d", len(realmEventsConfig.EnabledEventTypes)) + } + } else if ok, _ := keycloakClient.VersionIsGreaterThanOrEqualTo(testCtx, keycloak.Version_14); ok { if len(realmEventsConfig.EnabledEventTypes) != 79 { return fmt.Errorf("exptected to enabled_event_types to contain all(79) event types, but it contains %d", len(realmEventsConfig.EnabledEventTypes)) }