Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kochetkov-ma/kotlin-bdd-example
Kotlin BDD Cucumber / Kotest
https://github.com/kochetkov-ma/kotlin-bdd-example
bdd cucumber junit5 kotest kotlin spring spring-test
Last synced: 5 days ago
JSON representation
Kotlin BDD Cucumber / Kotest
- Host: GitHub
- URL: https://github.com/kochetkov-ma/kotlin-bdd-example
- Owner: kochetkov-ma
- Created: 2022-07-28T06:10:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-28T10:33:48.000Z (over 2 years ago)
- Last Synced: 2023-03-10T17:52:11.238Z (over 1 year ago)
- Topics: bdd, cucumber, junit5, kotest, kotlin, spring, spring-test
- Language: Kotlin
- Homepage:
- Size: 349 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
BDD подход при написании тестов на Kotlin. `Junit5` / `Cucumber` / `Kotest`
---## BDD и BDT презентация
- [BDD.pptx](pptx/BDD.pptx)
- [Требования](pptx/requirements.md)## Spring Boot
```groovy
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'// Sprint Boot Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured'
}
```
[ValidationController](src/main/kotlin/org/brewcode/bdd/ValidationController.kt) с одним POST методом по пути `/validation`## `JUnit5` и Spring Boot Test
```groovy
dependencies {
// JUnit5
testImplementation('org.junit.jupiter:junit-jupiter')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')
testImplementation('org.junit.platform:junit-platform-suite')
}
```
[Классический тест](src/test/kotlin/org/brewcode/bdd/unit/ValidationControllerClassicTest.kt)## `Cucumber 7` и Spring Boot Test
```groovy
dependencies {
// Cucumber
testImplementation 'io.cucumber:cucumber-java:7.4.1'
testImplementation 'io.cucumber:cucumber-junit-platform-engine:7.4.1'
testImplementation 'io.cucumber:cucumber-spring:7.4.1'
}
```
- [Cucumber Runner](src/test/kotlin/org/brewcode/bdd/cucumber/ValidationControllerBddCucumberTest.kt)
- [Cucumber Feature](src/test/resources/features/validation.feature)
- [Cucumber Steps](src/test/kotlin/org/brewcode/bdd/step/ValidationControllerStep.kt)
- [Cucumber Spring Configuration](src/test/kotlin/org/brewcode/bdd/step/CucumberSpringConfiguration.kt)## `Kotest 5` и Spring Boot Test
```groovy
dependencies {
// Kotest
testImplementation 'io.kotest:kotest-runner-junit5:5.3.2'
testImplementation 'io.kotest.extensions:kotest-extensions-spring:1.1.1'
}
```
[Kotest](src/test/kotlin/org/brewcode/bdd/kotest/ValidationControllerBddKotestTest.kt)## `Junit5` + `Allure` и Spring Boot Test
```groovy
dependencies {
implementation 'io.qameta.allure:allure-java-commons:2.21.0'
}
```
[JUnit5 BDD](src/test/java/org/brewcode/bdd/unit/ValidationControllerJunitBddTest.java)