This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.jupiter.api.* | |
import org.junit.jupiter.api.Assertions.assertEquals | |
class JUnit5JupiterBasedKotlinDslSketch { | |
@Test | |
fun goodOldWorld() { | |
assertEquals(2, 1 + 1) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// exmple from https://proandroiddev.com/writing-kotlin-dsls-with-nested-builder-pattern-66452476d5ef | |
// slightly modified | |
data class Business( | |
val name: String, | |
val address: Address, | |
val employees: List<Employee> | |
) { | |
@BusinessDsl | |
class BusinessBuilder { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.reactivex.Flowable; | |
import org.apache.commons.lang3.StringUtils; | |
import java.util.concurrent.TimeUnit; | |
public class RxJavaFizzBuzz { | |
public static void main(String[] args) throws InterruptedException { | |
Flowable<String> fizzes = Flowable.just("", "", "fizz").repeat(); | |
Flowable<String> buzzes = Flowable.just("", "", "", "", "buzz").repeat(); |