在我的rest体系结构中,有一个控制器(处理http请求)和一个服务(提供数据的业务逻辑)。对于自定义对象(农场),由于无法从服务方法中得到承诺,因此无法使用此选项,这是一个错误:
(/Users/giovannimarino/Projects/rt-cloud/services/farms/src/farms/farms.controller.ts:17:17):TypeError:无法在FarmsController.createFarm Fa
thenReturn("rrrr");当我尝试运行此方法时,出现了异常:Strict stubbingPlease check:
Typically, stubbing argument mismatch indicates user mistake when writing tests.However, there are legit scenarios when this exception generate
doNothing()来模拟,但是我用这个error面对:Unfinished stubbingExamples of correct stubbing: when(mock.isOk()).thenThrowmissing thenReturn()
2. you are trying to stub a final method, which
(testData)org.mockito.exceptions.misusing.UnfinishedStubbingException: when(mock.isOk()).thenReturn(true);
when(mock.isOk()).thenThrow3: you are stubbing the behaviour of another mock inside before &
thenReturn(500);时,我得到了这个错误: org.mockito.exceptions.misusing.UnfinishedStubbingException: when(mock.isOk()).thenReturn(true); 2. you are trying to stub a final method, which is
我收到的错误消息是:Strict stubbing argument mismatchTypically, stubbing argument mismatch indicates user mistake when writing tests.However, there are legit scenarios when this exception generates false negative signal:
- stu
getSingleResult());org.mockito.exceptions.misusing.UnfinishedStubbingException: when(mock.isOk()).thenReturn(true); 2. you are trying to stub a final method, which i
例外情况:Unfinished stubbing detected hereExamples of correct stubbing: when(mock.isOk()).thenThrowmissing thenReturn()
2. you are trying to stub a final method, which is not sup
}
Unfinished stubbingExamples of correct stubbing: when(mock.isOk()).thenThrowmissing thenReturn()
2. you are trying to stub a final method, which is not
Mockito.any(String.class))); 例外: org.mockito.exceptions.misusing.UnfinishedStubbingException: when(mock.isOk()).thenReturn(true); 2. you are trying to stub a final method, whi