@Test
public void testInvokeWithToken() throws Exception {

    String token = "token";
    Invoker invoker = Mockito.mock(Invoker.class);
    URL url = URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1&token=" + token);
    when(invoker.getUrl()).thenReturn(url);
    when(invoker.invoke(any(Invocation.class))).thenReturn(new AppResponse("result"));
    Map<String, Object> attachments = new HashMap<>();
    attachments.put(TOKEN_KEY, token);
    Invocation invocation = Mockito.mock(Invocation.class);
    when(invocation.getObjectAttachments()).thenReturn(attachments);
    Result result = tokenFilter.invoke(invoker, invocation);
    Assertions.assertEquals("result", result.getValue());
}