Fix Kotlin example in Spring MVC test docs

This commit updates spring-mvc-test-client.adoc to use valid Kotlin
syntax for a constructor.

Closes gh-37388

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan
2026-10-04 12:48:25 +02:00
committed by GitHub
parent 5e45b9be1b
commit eb9928f993
@@ -151,7 +151,7 @@ Kotlin::
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
val mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build()
restTemplate = RestTemplate(MockMvcClientHttpRequestFactory(mockMvc))
this.restTemplate = RestTemplate(MockMvcClientHttpRequestFactory(mockMvc))
// Test code that uses the above RestTemplate ...
----
@@ -188,7 +188,7 @@ Kotlin::
val restTemplate = RestTemplate()
// Create ExecutingResponseCreator with the original request factory
val withActualResponse = new ExecutingResponseCreator(restTemplate.getRequestFactory())
val withActualResponse = ExecutingResponseCreator(restTemplate.getRequestFactory())
val mockServer = MockRestServiceServer.bindTo(restTemplate).build()
mockServer.expect(requestTo("/profile")).andRespond(withSuccess())