@Repository
public interface ShopComponentsFramesRepository extends JpaRepository<ShopComponentFrame, Long> {
public List<ShopComponentFrame> findByComponentIdInAndShopId(Collection<Long> componentIdList,
Collection<Long> shopIdList);
public ShopComponentFrame findByComponentIdInAndShopId(Long componentId, Long shopId);
}
我有一个mockito junit测试类,包含以下代码,但编译器在抱怨——
findByComponentIdInAndShopId(Collection,Collection)方法对于ShopComponentsFramesRepository类型不明确
"
@Test
public void testRequestReceivingDropdownElements() {
ReceivingDropdownsView sampleDropdownsView = getReceivingDropdownsSample();
when(authorityManager.retrieveAuthorities(USER_NAME)).thenReturn(getSampleAuthoritiesView());
when(shopComponentFrameConverter.convertToView(anyObject())).thenReturn(getComponentFrame());
when(shopComponentsFramesRepository.findByComponentIdInAndShopId(anyObject(), anyObject()))
.thenReturn(getShopComponentFrameList());
when(shopComponentsFramesRepository.findByComponentIdInAndShopId(anyLong(), anyLong()))
.thenReturn(getShopComponentFrame());
知道我做错了什么吗?