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 SummaryFieldsModifier and TypeFieldDescriptionprotected org.springframework.boot.test.web.client.TestRestTemplateautowired test template (see Spring Boot doc)protected intlocal server port will be dynamic
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbefore()setup test envvoidgetBankAccount(String city) feature file matching "When"voidfeature file matching "And"voidfeature 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- 
CucumberSpringContextConfigurationpublic CucumberSpringContextConfiguration()
 
- 
- 
Method Details- 
before@BeforeEach public void before()setup test env
- 
getBankAccountfeature 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"
 
-