File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
main/kotlin/org/springframework/test/web/reactive/server
test/kotlin/org/springframework/test/web/reactive/server Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ inline fun <reified T : Any> RequestBodySpec.body(flow: Flow<T>): RequestHeaders
68
68
*/
69
69
@Suppress(" EXTENSION_SHADOWED_BY_MEMBER" )
70
70
inline fun <reified B : Any > ResponseSpec.expectBody (): KotlinBodySpec <B > =
71
- expectBody(B :: class .java ).returnResult().let {
71
+ expectBody(object : ParameterizedTypeReference < B >() {} ).returnResult().let {
72
72
object : KotlinBodySpec <B > {
73
73
74
74
override fun isEqualTo (expected : B ): KotlinBodySpec <B > = it
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ class WebTestClientExtensionsTests {
62
62
@Test
63
63
fun `ResponseSpec#expectBody with reified type parameters` () {
64
64
responseSpec.expectBody<Foo >()
65
- verify { responseSpec.expectBody(Foo :: class .java ) }
65
+ verify { responseSpec.expectBody(object : ParameterizedTypeReference < Foo >() {} ) }
66
66
}
67
67
68
68
@Test
You can’t perform that action at this time.
0 commit comments