Permalink
Browse files

Removed the need to explicitly execute

  • Loading branch information...
johanhaleby committed Sep 16, 2018
1 parent 28f105c commit 8e66e4ffb48c9bba2df579934cc35bbea81f7b55
@@ -52,10 +52,10 @@ inline fun <reified T : Any> hystrixObservableCommand(block: KystrixObservableCo
* withQueueSizeRejectionThreshold(5)
* withMaxQueueSize(10)
* }
*}.execute()
*}
* ```
*/
inline fun <reified T : Any> hystrixCommand(block: KystrixCommand<T>.() -> Unit): HystrixCommand<T> = KystrixCommand<T>().apply(block).build()
inline fun <reified T : Any> hystrixCommand(block: KystrixCommand<T>.() -> Unit): T = KystrixCommand<T>().apply(block).build().execute()
/**
* A base-class for shared Kystrix DSL functionality. This should never be used directly.
@@ -42,7 +42,7 @@ class KystrixCommandTest {
withQueueSizeRejectionThreshold(5)
withMaxQueueSize(10)
}
}.execute()
}
// Then
assertThat(greeting.message).isEqualTo("Have a nice day $firstName $lastName")
@@ -47,7 +47,7 @@ class KystrixSpringMonoCommandTest {
withQueueSizeRejectionThreshold(5)
withMaxQueueSize(10)
}
}.execute()
}
// Then
assertThat(greeting.message).isEqualTo("Have a nice day $firstName $lastName")

0 comments on commit 8e66e4f

Please sign in to comment.