Set value to mocked object but get null

后端 未结 6 659
无人共我
无人共我 2021-02-12 22:31

I have a simple class Foo to be mocked:

public class Foo {
   private String name;
   public Foo() {
   }
   public Foo(String name) {
     this.nam         


        
6条回答
  •  闹比i
    闹比i (楼主)
    2021-02-12 22:57

    You need to call real methods on the mocked objects. use @Spy

提交回复
热议问题