Mono.flatmap的Spock测试

时间:2018-03-13 18:48:33

标签: spring-boot mono spock

如何spock测试Class AService的这个功能,谢谢?

@服务

> main_vector=c("ABC","ABC","ABC","XYZ")
> support_vector <- sapply(main_vector, function(x) as.integer(x=="ABC"))
> support_vector
ABC ABC ABC XYZ 
  1   1   1   0 

我尝试了类似下面的内容,但是函数的调用为0  service.method(ApiResource.GOOD,b)

Class AService(val service: Service) 
{

  fun toTestMethod(a: A, bMono: Mono<B>): C {
    val currentMap: Mono<List<Map<*,*>>> = bMono.flatMap {b->
        service.method(ApiResource.GOOD, b)}

    return C(currentMap, a)
  }
}

0 个答案:

没有答案