Class CucumberSpringContextConfiguration
java.lang.Object
com.datengaertnerei.test.dataservice.cucumber.CucumberSpringContextConfiguration
@SpringBootTest(webEnvironment=RANDOM_PORT)
public class CucumberSpringContextConfiguration
extends Object
Example Cucumber context and step definitions for REST API testing
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.boot.test.web.client.TestRestTemplate
autowired test template (see Spring Boot doc)protected int
local server port will be dynamic -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
before()
setup test envvoid
getBankAccount
(String city) feature file matching "When"void
feature file matching "And"void
feature file matching "Then"
-
Field Details
-
restTemplate
@Autowired protected org.springframework.boot.test.web.client.TestRestTemplate restTemplateautowired test template (see Spring Boot doc) -
serverPort
@LocalServerPort protected int serverPortlocal server port will be dynamic
-
-
Constructor Details
-
CucumberSpringContextConfiguration
public CucumberSpringContextConfiguration()
-
-
Method Details
-
before
@BeforeEach public void before()setup test env -
getBankAccount
feature file matching "When"- Parameters:
city
- the city to fetch a bank for
-
theClientReceivesStatus
@Then("the client receives status code OK") public void theClientReceivesStatus()feature file matching "Then" -
theClientReceivesProduct
@And("the client receives bank account in this city") public void theClientReceivesProduct()feature file matching "And"
-