@Test
public void testInvoke() throws Exception {

    RpcInvocation invocation = new RpcInvocation("getPerson", "org.apache.dubbo.rpc.support.DemoService",
            "org.apache.dubbo.rpc.support.DemoService:dubbo", new Class[]{Person.class}, new Object[]{new Person("dubbo", 10)});
    URL url = URL.valueOf("test://test:11/org.apache.dubbo.rpc.support.DemoService?" +
            "accesslog=true&group=dubbo&version=1.1&generic=true");
    Invoker invoker = Mockito.mock(Invoker.class);
    Map<String, Object> person = new HashMap<String, Object>();
    person.put("name", "dubbo");
    person.put("age", 10);
    AppResponse mockRpcResult = new AppResponse(person);
    when(invoker.invoke(any(Invocation.class))).thenReturn(AsyncRpcResult.newDefaultAsyncResult(mockRpcResult, invocation));
    when(invoker.getUrl()).thenReturn(url);
    when(invoker.getInterface()).thenReturn(DemoService.class);
    Result asyncResult = genericImplFilter.invoke(invoker, invocation);
    Result result = asyncResult.get();
    genericImplFilter.onResponse(result, invoker, invocation);
    Assertions.assertEquals(Person.class, result.getValue().getClass());
    Assertions.assertEquals(10, ((Person) result.getValue()).getAge());
}