티스토리 뷰

공부

Mockito match any class argument

승가비 2024. 6. 1. 11:04
728x90
when(a.method(any(Class.class))).thenReturn(b);

https://stackoverflow.com/questions/7500312/mockito-match-any-class-argument

 

Mockito match any class argument

Is there a way to match any class argument of the below sample routine? class A { public B method(Class<? extends A> a) {} } How can I always return a new B() regardless of which class...

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

git tag & history | awk '{$1=""; print substr($0,2)}'  (0) 2024.06.22
Bootstrap Glyphicon Components  (0) 2024.06.01
[react] .env  (0) 2024.06.01
[linux] netstat -nltp  (0) 2024.05.29
[tar] tar -cvf; tar -xvf; tar -zcvf; tar -zxvf;  (0) 2024.05.29
댓글