Mockito ambiguous method call
我正在尝试存根方法调用,例如
when(amazonDynamoDBClient.batchWriteItem(anyObject())).thenReturn(batchWriteItemResultMock);
我收到此错误
Error:(198, 34) java: reference to batchWriteItem is ambiguous
both method batchWriteItem(com.amazonaws.services.dynamodbv2.model.BatchWriteItemRequest) in com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient and method batchWriteItem(java.util.Map<java.lang.String,java.util.List<com.amazonaws.services.dynamodbv2.model.WriteRequest>>) in com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient match
我看不出这是如何模棱两可的 - 方法签名是不同的,即
public BatchWriteItemResult batchWriteItem(BatchWriteItemRequest request) {
和
public BatchWriteItemResult batchWriteItem(Map<String, List<WriteRequest>> requestItems) {
我在这里做错了什么?