我一直在阅读关于参数捕获器的内容,但是越读越迷惑。有没有人能举个例子来解释一下这个概念呢?
我一直在阅读关于参数捕获器的内容,但是越读越迷惑。有没有人能举个例子来解释一下这个概念呢?
ArgumentCaptor<Person> argument = ArgumentCaptor.forClass(Person.class);
verify(mock).doSomething(argument.capture());
assertEquals("John", argument.getValue().getName());