@Override
    public ExecuteContext doBefore(ExecuteContext context) {
        final Object url = context.getArguments()[0];
        final Map<String, String> parameters = getParameters(url);
        final String application = parameters.get(CommonConst.DUBBO_APPLICATION);
        final String interfaceName = parameters.get(CommonConst.DUBBO_INTERFACE);
        if (Objects.nonNull(application) && Objects.nonNull(interfaceName)) {
            DubboApplicationCache.INSTANCE.cache(interfaceName, application);
        }
        return context;
    }
@Test
    public void doBefore() throws Exception {
        String interfaceName = "io.sermant.test";
        String application = "test";
        String protocol = "dubbo";
        String host = "localhost";
        int port = 8080;
        final ClusterInterceptor clusterInterceptor = new ClusterInterceptor();
        final HashMap<String, String> params = new HashMap<>();
        params.put("interface", interfaceName);
        params.put("application", application);
        final URL url = new URL(protocol, host, port, params);
        clusterInterceptor.doBefore(buildContext(new Object[]{url}));
        Assert.assertEquals(DubboApplicationCache.INSTANCE.getApplicationCache().get(interfaceName), application);
        DubboApplicationCache.INSTANCE.getApplicationCache().clear();
        final com.alibaba.dubbo.common.URL aliUrl = new com.alibaba.dubbo.common.URL(protocol, host, port, params);
        clusterInterceptor.doBefore(buildContext(new Object[]{aliUrl}));
        Assert.assertEquals(DubboApplicationCache.INSTANCE.getApplicationCache().get(interfaceName), application);
        DubboApplicationCache.INSTANCE.getApplicationCache().clear();
    }