Skip to content

kochetkov-ma/kotlin-bdd-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BDD подход при написании тестов на Kotlin. Junit5 / Cucumber / Kotest

BDD и BDT презентация

Spring Boot

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 с одним POST методом по пути /validation

JUnit5 и Spring Boot Test

dependencies {
    // JUnit5
    testImplementation('org.junit.jupiter:junit-jupiter')
    testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')
    testImplementation('org.junit.platform:junit-platform-suite')
}

Классический тест

Cucumber 7 и Spring Boot Test

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'
}

Kotest 5 и Spring Boot Test

dependencies {
    // Kotest
    testImplementation 'io.kotest:kotest-runner-junit5:5.3.2'
    testImplementation 'io.kotest.extensions:kotest-extensions-spring:1.1.1'
}

Kotest

Junit5 + Allure и Spring Boot Test

dependencies {
    implementation 'io.qameta.allure:allure-java-commons:2.21.0'
}

JUnit5 BDD