при запуске теста mockito возникает исключение WrongTypeOfReturnValue

Ошибка подробно:

org.mockito.exceptions.misusing.WrongTypeOfReturnValue: 
Boolean cannot be returned by updateItemAttributesByJuId()
updateItemAttributesByJuId() should return ResultRich
This exception might occur in wrongly written multi-threaded tests.
Please refer to Mockito FAQ on limitations of concurrency testing.

мой код:

@InjectMocks
protected ItemArrangeManager arrangeManagerSpy = spy(new ItemArrangeManagerImpl());
@Mock
protected JuItemWriteService juItemWriteService;

when(arrangeManagerSpy
    .updateItemAttributes(mapCaptor.capture(), eq(juId), eq(itemTO.getSellerId())))
    .thenReturn(false);

Как видите, я звонюwhen наupdateItemAttributes (который возвращаетboolean) не наupdateItemAttributesByJuId.

Why is Mockito attempting to return a boolean from updateItemAttributesByJuId? How can this be rectified?

Ответы на вопрос(12)

Ваш ответ на вопрос