我试图测试处理转换和持久性的服务实现。 我有一个存储库嘲笑和转换服务连线 是否有可能在Spock有一个模拟回传给它的对象返回? 我想写的语法如下。 即 // Have this method return the object that has been passed to it.
repository.save(_ as Entity) >> (Entity) _
我试着为spock中的CompletableFuture创建存根或模拟。我的方法被称为异步并返回CompletableFuture。在spock方法中总是返回null。怎么了? public class ProductFactory() {
@Autowired
ProductRepository repository;
public Product create