我有一个返回自定义对象未来的方法,如下所示
@Async
public Future<Map<ObjectId, Field>> execute(final List<GlobalValidation> globalUniqueValidations,
final Map<ObjectId, ValidationField> evalFieldValueMap, final Map<ObjectId, Field> inputFieldValuesMap) {
LOGGER.debug("Triggering unique validations");
if (CollectionUtils.isEmpty(globalUniqueValidations)) {
return new AsyncResult<Map<ObjectId, Field>>(inputFieldValuesMap);
}
for (final GlobalValidation globalValidation : globalUniqueValidations) {
executeUniqueValidationPerCollection(globalValidation, evalFieldValueMap, inputFieldValuesMap);
}
return new AsyncResult<Map<ObjectId, Field>>(inputFieldValuesMap);
}
请帮助我了解如何编写单元测试用例以使用MockitoJUnitRunner返回AsyncResult<Map<ObjectId, Field>>
对象类型