@Override
    public ExecuteContext before(ExecuteContext context) {
        String name = context.getMethod().getName();
        if (context.getArguments() == null || context.getArguments().length == 0) {
            return context;
        }
        Object argument = context.getArguments()[0];
        if ("setName".equals(name)) {
            if (argument == null || argument instanceof String) {
                setAppNameAndPutParameters(context.getObject(), (String) argument);
            }
        } else {
            if (argument == null || argument instanceof Map<?, ?>) {
                context.getArguments()[0] = ParametersUtils.putParameters((Map<String, String>) argument,
                        routerConfig);
            }
        }
        return context;
    }
@Test
    public void testSetName() throws NoSuchMethodException {
        Object[] args = new Object[1];
        args[0] = "";
        ApplicationConfig applicationConfig = new ApplicationConfig();
        ExecuteContext context = ExecuteContext.forMemberMethod(applicationConfig,
                ApplicationConfig.class.getMethod("setName", String.class), args, null, null);

        // the app name is empty
        interceptor.before(context);
        Assert.assertNull(DubboCache.INSTANCE.getAppName());
        Assert.assertNull(applicationConfig.getParameters());

        // the app name is not empty
        args[0] = "foo";
        interceptor.before(context);
        Assert.assertEquals("foo", DubboCache.INSTANCE.getAppName());
        Map<String, String> parameters = applicationConfig.getParameters();
        Assert.assertNotNull(parameters);
        Assert.assertEquals(0, parameters.size());
    }