返回

spring boot-在测试用例中,statment在将springboot版本从2.1.7升级到2.6.4后给出错误

发布时间:2022-06-08 23:39:06 217
# java# java

更新后Spring Boot version to 2.6.4我在旧的测试用例中遇到错误version 2.1.7工作正常

@Test
fun `Should include id in all outbound requests`() {
    (authenticationSource as TestAuthenticationSource).setCoordinatorToken()
    val request = PersonSearch().apply {
        firstName = “Xyz”
        lastName = “Abc”
    }
    val oid = UUID.randomUUID().toString()

    client
            .post()
            .uri("/v/search/outbound")
            .headers {
                it.setBearerAuth("fakeToken")
                it.set(CORRELATION_ID, oid)
            }
            .body(Mono.just(request), PersonSearch::class.java)
            .exchange()

    assertThat(server.requestCount).isEqualTo(2)
   // the bellow line give error 
    assertThat(server.takeAllRequests()).allSatisfy { assertThat(it.headers.toMultimap()).containsEntry(CORRELATION_ID, listOf(oid)) }

  // Trying in this way as well
    assertThat(server.takeAllRequests()).allSatisfy { it -> assertThat(it.headers.toMultimap()).containsEntry(CORRELATION_ID, listOf(oid)) }
}

在里面错误is将第一行显示为-

Overload resolution ambiguity. All these functions match.
public open fun allSatisfy(requirements: Consumer!): ObjectArrayAssert<RecordedRequest!>! defined in org.assertj.core.api.ObjectArrayAssert
public open fun allSatisfy(requirements: ThrowingConsumer!): ObjectArrayAssert<RecordedRequest!>! defined in org.assertj.core.api.ObjectArrayAssert

当它抛出相同的例外运行时的消息-

Kotlin: Overload resolution ambiguity: 
public open fun allSatisfy(p0: Consumer!): ObjectArrayAssert<RecordedRequest!>! defined in org.assertj.core.api.ObjectArrayAssert
public open fun allSatisfy(p0: ThrowingConsumer!): ObjectArrayAssert<RecordedRequest!>! defined in org.assertj.core.api.ObjectArrayAssert
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(1)
按点赞数排序
用户头像
下一篇
数组-垂直组合查询结果 2022-06-08 21:32:37