The Kotlin mocking library mockk lets's you mock a class like this:
class Foo {
fun foo() = "foo"
}
val foo = mockk<Foo>()
every { foo.foo() } returns "bar" // 👈 make the foo mock return "bar"
The Kotlin mocking library mockk lets's you mock a class like this:
class Foo {
fun foo() = "foo"
}
val foo = mockk<Foo>()
every { foo.foo() } returns "bar" // 👈 make the foo mock return "bar"
/** | |
* [Gradle init script](https://docs.gradle.org/current/userguide/init_scripts.html) that has | |
* to be places in one of the [documented locations](https://docs.gradle.org/current/userguide/init_scripts.html#sec:using_an_init_script), | |
* for example | |
* - `$GRADLE_USER_HOME/init.gradle.kts`, respectively | |
* - `$HOME/init.gradle.kts | |
*/ | |
rootProject { | |
logger.info("Running init script on $name") |
This Markdown file is 90% the output of error_handling.bash
.
I wrote the script / this document to describe the shell options errexit
, inherit_errexit
, and errtrace
as well as the ERR
trap and their conditions and interactions in more detail as this is what I always
failed to understand with the pieces of information I found so far.
fun <A, B, C, R> multiReceiver(f: A.() -> B.() -> C.() -> R) = { a: A, b: B, c: C -> f(a)(b)(c) } | |
val sample1: (X, Y, Z) -> Int = multiReceiver { { { x + y + z } } } | |
val sample2: X.() -> Y.() -> Z.() -> Int = { { { x + y + z } } } | |
class X(val x: Int) | |
class Y(val y: Int) | |
class Z(val z: Int) | |
fun main() { |
#!/bin/sh | |
# Abort script at first error, when a command exits with non-zero status | |
# (except in until or while loops, if-tests, list constructs) | |
set -e | |
# Attempt to use undefined variable outputs error message, and forces an exit | |
set -u | |
# Similar to verbose mode (-v), but expands commands | |
#set -x |
import lombok.SneakyThrows; | |
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.core.MethodParameter; | |
import org.springframework.http.server.ServletServerHttpRequest; | |
import org.springframework.lang.NonNull; | |
import org.springframework.lang.NonNullApi; | |
import org.springframework.lang.Nullable; | |
import org.springframework.util.MultiValueMap; |