@Override
    public boolean needToLoad(FilterInvoker invoker) {
        AbstractInterfaceConfig<?, ?> config = invoker.getConfig();

        String enabled = config.getParameter(SentinelConstants.SOFA_RPC_SENTINEL_ENABLED);
        if (StringUtils.isNotBlank(enabled)) {
            return Boolean.parseBoolean(enabled);
        }

        return RpcConfigs.getOrDefaultValue(SentinelConstants.SOFA_RPC_SENTINEL_ENABLED, true);
    }
@Test
    public void testNeedToLoadProvider() {
        SentinelSofaRpcProviderFilter providerFilter = new SentinelSofaRpcProviderFilter();
        ProviderConfig providerConfig = new ProviderConfig();
        providerConfig.setInterfaceId(Serializer.class.getName());
        providerConfig.setId("AAA");
        FilterInvoker invoker = new FilterInvoker(null, null, providerConfig);
        assertTrue(providerFilter.needToLoad(invoker));

        providerConfig.setParameter(SentinelConstants.SOFA_RPC_SENTINEL_ENABLED, "false");
        assertFalse(providerFilter.needToLoad(invoker));

        providerConfig.setParameter(SentinelConstants.SOFA_RPC_SENTINEL_ENABLED, "");
        assertTrue(providerFilter.needToLoad(invoker));

        RpcConfigs.putValue(SentinelConstants.SOFA_RPC_SENTINEL_ENABLED, "false");
        assertFalse(providerFilter.needToLoad(invoker));
    }