quand je lance mockito test se produit WrongTypeOfReturnValue Exception

Des détails de l'erreur:

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.

mon code :

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

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

Comme vous pouvez le voir, je fais appel when sur updateItemAttributes (qui n'a de retour d'un boolean) et non pas sur updateItemAttributesByJuId.

  1. Pourquoi est Mockito de tenter de renvoyer un boolean de updateItemAttributesByJuId?
  2. Comment cela peut-il être corrigé?