@@ -0,0 +1,1374 @@
+package com.damienfremont.blog;%0A%0Aimport static org.assertj.core.api.StrictAssertions.assertThat;%0A%0Aimport org.junit.runner.RunWith;%0A%0Aimport cucumber.api.CucumberOptions;%0Aimport cucumber.api.java.Before;%0Aimport cucumber.api.java.en.Given;%0Aimport cucumber.api.java.en.Then;%0Aimport cucumber.api.java.en.When;%0Aimport cucumber.api.java8.En;%0Aimport cucumber.api.junit.Cucumber;%0A%0A// It's modular code and functions reuse is possible. But it's not very productive because of the duplicate annotation/function syntax.%0A@RunWith(Cucumber.class)%0A@CucumberOptions(strict = true, features = %22features%22)%0Apublic class C_CucumberJava6Test implements En %7B%0A%0A%09ClassToTest classToTest;%0A%09String receipt;%0A%09String refund;%0A%0A%09@Before%0A%09public void beforeScenario() %7B%0A%09%09classToTest = new ClassToTest();%0A%09%7D%0A%0A%09@Given(%22%5EJeff has bought a microwave for %5C%5C$(%5C%5Cd+) - C$%22)%0A%09public void jeff_has_bought_a_microwave_for(Integer amount) %7B%0A%09%09receipt = classToTest.buy(%22microwave%22, amount);%0A%09%7D%0A%0A%09@Given(%22%5Ehe has a receipt - C$%22)%0A%09public void he_has_a_receipt() %7B%0A%09%09assertThat(receipt).isNotNull();%0A%09%7D%0A%0A%09@When(%22%5Ehe returns the microwave - C$%22)%0A%09public void he_returns_the_microwave() %7B%0A%09%09refund = classToTest.returns(%22microwave%22, receipt);%0A%09%7D%0A%0A%09@Then(%22%5EJeff should be refunded %5C%5C$(%5C%5Cd+) - C$%22)%0A%09public void jeff_should_be_refunded(Integer amount) %7B%0A%09%09assertThat(refund).isNotNull().contains(amount.toString());%0A%09%7D%0A%7D%0A

Create C_CucumberJava6Test.java