我正在使用 Mockito 编写测试用例,并且必须为方法编写期望(签名如下所示)
public Object process(Employee e);
在我的测试课中,我必须模拟我的期望如下:
when(someClass.process("any Employee with id between 1 and 100.").thenReturn(object1);
when(someClass.process("any Employee with id between 101 and 200.").thenReturn(object2);
我怎样才能有条件地设定期望。