Я определил свой контекстный класс Cucumber как:
@RunWith(Cucumber.class)
@CucumberOptions(
features = "src/test/resources/features",
glue = "com.a.dummy.bdd.steps",
plugin = {"pretty", "html:target/cucumber"},
strict = true,
dryRun = true
)
public class CucumberTest {
}
Вот мой тестовый класс:
public class PingTest {
@When("^the client calls /ping")
public void the_client_calls_GET_ping() {
}
@Then("^the client receives status code of (\\d+)$")
public void the_client_receives_status_code_of(int statusCode) {
}
@And("^the client receives request date")
public void the_client_receives_request_date() {
}
}
Это мое ping.feature
определение:
Feature: the application responds the ping request
Scenario: client makes call to GET /ping
When the client calls /ping
Then the client receives status code of 200
And the client receives request date
Тест на огурец пропущен, так как для параметра dryRun установлено значение true. В журнале нет сообщения о том, почему проверка не удалась.
Вывод:
2020-04-02 19:09:09.246 INFO 4156 --- [ main] c.a.dummy.DummyApplicationTests : Started DummyApplicationTests in 4.883 seconds (JVM running for 5.991)
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.323 s - in com.a.dummy.DummyApplicationTests
[INFO] Running com.a.dummy.bdd.CucumberTest
Scenario: client makes call to GET /ping # src/test/resources/features/ping.feature:3
When the client calls /ping # com.a.dummy.bdd.steps.PingTest.the_client_calls_GET_ping()
Then the client receives status code of 200 # com.a.dummy.bdd.steps.PingTest.the_client_receives_status_code_of(int)
And the client receives request date # com.a.dummy.bdd.steps.PingTest.the_client_receives_request_date()
1 Scenarios (1 skipped)
3 Steps (3 skipped)
0m0.149s
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.149 s - in com.a.dummy.bdd.CucumberTest
2020-04-02 19:09:09.515 INFO 4156 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2020-04-02 19:09:09.520 INFO 4156 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-04-02 19:09:09.520 INFO 4156 --- [extShutdownHook] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
2020-04-02 19:09:09.531 INFO 4156 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-04-02 19:09:09.535 INFO 4156 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.380 s
[INFO] Finished at: 2020-04-02T19:09:10+03:00
[INFO] ------------------------------------------------------------------------
Как понять основную причину и исправить ее для моего случая?
PS 1: Я использую Spring Boot 2.2 .6.RELEASE, Cucumber 5.5.0, JUnit 5 без исключения винтажных.
PS 2: 2 запускаются. Одним из них является стандартный тест Spring Boot Application, который является тестом JUnit.