Merge branch '5.3.x'

This commit is contained in:
Sébastien Deleuze 2022-07-13 10:10:42 +02:00
commit b135cbe7c8
2 changed files with 13 additions and 13 deletions

View File

@ -1368,7 +1368,7 @@ The following example shows the corresponding `ExampleBean` class:
} }
} }
---- ----
[source,java,indent=0,subs="verbatim,quotes",role="secondary"] [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin .Kotlin
---- ----
class ExampleBean( class ExampleBean(
@ -4727,7 +4727,7 @@ as the following example shows:
---- ----
class SimpleMovieLister { class SimpleMovieLister {
@Autowired @set:Autowired
lateinit var movieFinder: MovieFinder lateinit var movieFinder: MovieFinder
// ... // ...
@ -5880,7 +5880,7 @@ named `movieFinder` injected into its setter method:
---- ----
class SimpleMovieLister { class SimpleMovieLister {
@Resource @set:Resource
private lateinit var movieFinder: MovieFinder private lateinit var movieFinder: MovieFinder
} }
@ -7247,11 +7247,11 @@ preceding example:
class SimpleMovieLister { class SimpleMovieLister {
@Inject @Inject
lateinit var movieFinder: MovieFinder lateinit var movieFinder: Provider<MovieFinder>
fun listMovies() { fun listMovies() {
movieFinder.findMovies(...) movieFinder.get().findMovies(...)
// ... // ...
} }
} }
@ -9594,7 +9594,7 @@ of creating a custom composed annotation. The following example defines a custom
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin .Kotlin
---- ----
@Target(AnnotationTarget.TYPE) @Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@Profile("production") @Profile("production")
annotation class Production annotation class Production

View File

@ -2522,7 +2522,7 @@ listeners. The following listing demonstrates this style of configuration:
} }
---- ----
[source,java,indent=0,subs="verbatim,quotes",role="secondary"] [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin .Kotlin
---- ----
@ContextConfiguration @ContextConfiguration
@ -7366,7 +7366,7 @@ no other expectations will be asserted.
import org.springframework.test.web.servlet.get import org.springframework.test.web.servlet.get
mockMvc.get("/accounts/1").andExpect { mockMvc.get("/accounts/1").andExpect {
status().isOk() status { isOk() }
} }
---- ----
@ -7414,7 +7414,7 @@ The following test asserts that binding or validation failed:
import org.springframework.test.web.servlet.post import org.springframework.test.web.servlet.post
mockMvc.post("/persons").andExpect { mockMvc.post("/persons").andExpect {
status().isOk() status { isOk() }
model { model {
attributeHasErrors("person") attributeHasErrors("person")
} }
@ -7442,7 +7442,7 @@ request. You can do so as follows, where `print()` is a static import from
mockMvc.post("/persons").andDo { mockMvc.post("/persons").andDo {
print() print()
}.andExpect { }.andExpect {
status().isOk() status { isOk() }
model { model {
attributeHasErrors("person") attributeHasErrors("person")
} }
@ -7472,7 +7472,7 @@ other expectations, as the following example shows:
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin .Kotlin
---- ----
var mvcResult = mockMvc.post("/persons").andExpect { status().isOk() }.andReturn() var mvcResult = mockMvc.post("/persons").andExpect { status { isOk() } }.andReturn()
// ... // ...
---- ----
@ -7592,7 +7592,7 @@ or reactive type such as Reactor `Mono`:
@Test @Test
fun test() { fun test() {
var mvcResult = mockMvc.get("/path").andExpect { var mvcResult = mockMvc.get("/path").andExpect {
status().isOk() // <1> status { isOk() } // <1>
request { asyncStarted() } // <2> request { asyncStarted() } // <2>
// TODO Remove unused generic parameter // TODO Remove unused generic parameter
request { asyncResult<Nothing>("body") } // <3> request { asyncResult<Nothing>("body") } // <3>
@ -7601,7 +7601,7 @@ or reactive type such as Reactor `Mono`:
mockMvc.perform(asyncDispatch(mvcResult)) // <4> mockMvc.perform(asyncDispatch(mvcResult)) // <4>
.andExpect { .andExpect {
status().isOk() // <5> status { isOk() } // <5>
content().string("body") content().string("body")
} }
} }