@Override
    public Mono<AuthProvider> enable(String name) {
        return client.get(AuthProvider.class, name)
            .flatMap(authProvider -> updateAuthProviderEnabled(enabled -> enabled.add(name))
                .thenReturn(authProvider)
            );
    }
@Test
    void testEnable() {
        // Create a test auth provider
        AuthProvider authProvider = createAuthProvider("github");
        when(client.get(eq(AuthProvider.class), eq("github"))).thenReturn(Mono.just(authProvider));

        ArgumentCaptor<ConfigMap> captor = ArgumentCaptor.forClass(ConfigMap.class);
        when(client.update(captor.capture())).thenReturn(Mono.empty());

        ConfigMap configMap = new ConfigMap();
        configMap.setData(new HashMap<>());
        when(client.fetch(eq(ConfigMap.class), eq(SystemSetting.SYSTEM_CONFIG)))
            .thenReturn(Mono.just(configMap));

        AuthProvider local = createAuthProvider("local");
        local.getMetadata().getLabels().put(AuthProvider.PRIVILEGED_LABEL, "true");
        when(client.list(eq(AuthProvider.class), any(), any())).thenReturn(Flux.just(local));

        // Call the method being tested
        Mono<AuthProvider> result = authProviderService.enable("github");

        assertEquals(authProvider, result.block());
        ConfigMap value = captor.getValue();
        String providerSettingStr = value.getData().get(SystemSetting.AuthProvider.GROUP);
        Set<String> enabled =
            JsonUtils.jsonToObject(providerSettingStr, SystemSetting.AuthProvider.class)
                .getEnabled();
        assertThat(enabled).containsExactly("github");
        // Verify the result
        verify(client).get(AuthProvider.class, "github");
        verify(client).fetch(eq(ConfigMap.class), eq(SystemSetting.SYSTEM_CONFIG));
    }