cucumber java8 (#2306)

* minor logging fix

* spring security sso

* use basic auth

* use form login

* cleanup

* cleanup

* final cleanup

* second client app for sso

* spring boot bootstrap

* add logic

* cleanup

* add simple controller

* add thymeleaf and security

* minor fix

* minor fix

* add more boot properties

* fix live test

* fix live test

* minor fix

* semaphores

* fix configuration

* kotlin collection

* add more collection examples

* minor upgrade

* cucumber java8
This commit is contained in:
Doha2012 2017-07-24 09:23:18 +02:00 committed by Grzegorz Piwowarek
parent 9c4042eb88
commit f58c41de4d
4 changed files with 51 additions and 0 deletions

View File

@ -45,6 +45,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java8</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.pitest</groupId>

View File

@ -0,0 +1,12 @@
package com.baeldung.testing.shopping;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features = { "classpath:features/shopping.feature" })
public class ShoppingIntegrationTest {
}

View File

@ -0,0 +1,22 @@
package com.baeldung.testing.shopping;
import static org.junit.Assert.assertEquals;
import cucumber.api.java8.En;
public class ShoppingStepsDef implements En {
private int budget = 0;
public ShoppingStepsDef() {
Given("I have (\\d+) in my wallet", (Integer money) -> budget = money);
When("I buy .* with (\\d+)", (Integer price) -> budget -= price);
Then("I should have (\\d+) in my wallet", (Integer finalBudget) -> {
assertEquals(budget, finalBudget.intValue());
});
}
}

View File

@ -0,0 +1,11 @@
Feature: Shopping
Scenario: Track my budget
Given I have 100 in my wallet
When I buy milk with 10
Then I should have 90 in my wallet
Scenario: Track my budget
Given I have 200 in my wallet
When I buy rice with 20
Then I should have 180 in my wallet