@@ -179,7 +179,7 @@ Kotlin::
179179scenario.publish(MyApplicationEvent(…)).…
180180
181181// Start with a bean invocation
182- scenario.stimulate(() -> someBean.someMethod(…)).…
182+ scenario.stimulate(Runnable { someBean.someMethod(…) } ).…
183183----
184184======
185185
@@ -263,9 +263,9 @@ Kotlin::
263263[source, kotlin, role="secondary"]
264264----
265265scenario.publish(new MyApplicationEvent(…))
266- .andWaitForEventOfType(SomeOtherEvent::class)
267- .matching( event -> …)
268- .toArriveAndVerify( event -> …)
266+ .andWaitForEventOfType(SomeOtherEvent::class.java )
267+ .matching { event -> … }
268+ .toArriveAndVerify { event -> … }
269269----
270270======
271271
@@ -287,9 +287,9 @@ Kotlin::
287287+
288288[source, kotlin, role="secondary"]
289289----
290- scenario.publish(new MyApplicationEvent(…))
291- .andWaitForStateChange(() -> someBean.someMethod(…)))
292- .andVerify( result -> …)
290+ scenario.publish(MyApplicationEvent(…))
291+ .andWaitForStateChange { someBean.someMethod(…) }
292+ .andVerify { result -> … }
293293----
294294======
295295
@@ -310,7 +310,7 @@ Java::
310310[source, java, subs="+quotes", role="primary"]
311311----
312312scenario.publish(new MyApplicationEvent(…))
313- **.customize(it -> it .atMost(Duration.ofSeconds(2)))**
313+ **.customize(conditionFactory -> conditionFactory .atMost(Duration.ofSeconds(2)))**
314314 .andWaitForEventOfType(SomeOtherEvent.class)
315315 .matching(event -> …)
316316 .toArriveAndVerify(event -> …);
@@ -320,10 +320,10 @@ Kotlin::
320320[source, kotlin, subs="+quotes", role="secondary"]
321321----
322322scenario.publish(MyApplicationEvent(…))
323- **.customize(it -> it.atMost(Duration.ofSeconds(2))) **
324- .andWaitForEventOfType(SomeOtherEvent::class)
325- .matching( event -> …)
326- .toArriveAndVerify( event -> …)
323+ **.customize { it.atMost(Duration.ofSeconds(2)) } **
324+ .andWaitForEventOfType(SomeOtherEvent::class.java )
325+ .matching { event -> … }
326+ .toArriveAndVerify { event -> … }
327327----
328328======
329329
@@ -348,7 +348,7 @@ class MyTests {
348348
349349 @Override
350350 Function<ConditionFactory, ConditionFactory> getDefaultCustomizer(Method method, ApplicationContext context) {
351- return it -> …;
351+ return conditionFactory -> …;
352352 }
353353 }
354354}
@@ -361,14 +361,14 @@ Kotlin::
361361class MyTests {
362362
363363 @Test
364- fun myTestCase(scenario : Scenario) {
364+ fun myTestCase(scenario: Scenario) {
365365 // scenario will be pre-customized with logic defined in MyCustomizer
366366 }
367367
368368 class MyCustomizer : ScenarioCustomizer {
369369
370- override fun getDefaultCustomizer(method : Method, context : ApplicationContext) : Function<ConditionFactory, ConditionFactory> {
371- return it -> …
370+ override fun getDefaultCustomizer(method: Method, context: ApplicationContext): UnaryOperator< ConditionFactory> {
371+ return UnaryOperator { conditionFactory -> … }
372372 }
373373 }
374374}
0 commit comments