@Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        if (applicationName != null && !applicationName.isEmpty()) {
            invocation.setAttachment(DubboUtils.SENTINEL_DUBBO_APPLICATION_KEY, applicationName);
        }
        return invoker.invoke(invocation);
    }
@Test
    public void testInvokeApplicationKey() {
        Invoker invoker = mock(Invoker.class);
        Invocation invocation = mock(Invocation.class);
        URL url = URL.valueOf("test://test:111/test?application=serviceA");
        when(invoker.getUrl()).thenReturn(url);

        ApplicationModel applicationModel = FrameworkModel.defaultModel().newApplication();
        applicationModel.getApplicationConfigManager().setApplication(new ApplicationConfig("serviceA"));
        DubboAppContextFilter filter = new DubboAppContextFilter(applicationModel);
        filter.invoke(invoker, invocation);
        verify(invoker).invoke(invocation);

        verify(invocation).setAttachment(DubboUtils.SENTINEL_DUBBO_APPLICATION_KEY, "serviceA");
        applicationModel.destroy();
    }