diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index b83088366a..3ff41f1d61 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -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 ---- class ExampleBean( @@ -4727,7 +4727,7 @@ as the following example shows: ---- class SimpleMovieLister { - @Autowired + @set:Autowired lateinit var movieFinder: MovieFinder // ... @@ -5880,7 +5880,7 @@ named `movieFinder` injected into its setter method: ---- class SimpleMovieLister { - @Resource + @set:Resource private lateinit var movieFinder: MovieFinder } @@ -7247,11 +7247,11 @@ preceding example: class SimpleMovieLister { @Inject - lateinit var movieFinder: MovieFinder + lateinit var movieFinder: Provider 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"] .Kotlin ---- - @Target(AnnotationTarget.TYPE) + @Target(AnnotationTarget.CLASS) @Retention(AnnotationRetention.RUNTIME) @Profile("production") annotation class Production diff --git a/src/docs/asciidoc/testing.adoc b/src/docs/asciidoc/testing.adoc index f34c207471..b7b1ec16b4 100644 --- a/src/docs/asciidoc/testing.adoc +++ b/src/docs/asciidoc/testing.adoc @@ -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 ---- @ContextConfiguration @@ -7366,7 +7366,7 @@ no other expectations will be asserted. import org.springframework.test.web.servlet.get 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 mockMvc.post("/persons").andExpect { - status().isOk() + status { isOk() } model { attributeHasErrors("person") } @@ -7442,7 +7442,7 @@ request. You can do so as follows, where `print()` is a static import from mockMvc.post("/persons").andDo { print() }.andExpect { - status().isOk() + status { isOk() } model { attributeHasErrors("person") } @@ -7472,7 +7472,7 @@ other expectations, as the following example shows: [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] .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 fun test() { var mvcResult = mockMvc.get("/path").andExpect { - status().isOk() // <1> + status { isOk() } // <1> request { asyncStarted() } // <2> // TODO Remove unused generic parameter request { asyncResult("body") } // <3> @@ -7601,7 +7601,7 @@ or reactive type such as Reactor `Mono`: mockMvc.perform(asyncDispatch(mvcResult)) // <4> .andExpect { - status().isOk() // <5> + status { isOk() } // <5> content().string("body") } }