@@ -0,0 +1,1066 @@
+package com.damienfremont.blog;%0A%0Aimport static org.assertj.core.api.StrictAssertions.assertThat;%0A%0Aimport org.junit.Test;%0A%0Aimport cucumber.api.java.Before;%0A%0A// It's stable and behaviour-oriented code. But functions reuse is not possible, and Javadoc is not an open collaboration format for other people like Product-Owner.%0A/**%0A * Feature: Refund item%0A */%0Apublic class B_BetterJunitTest %7B%0A%0A%09ClassToTest classToTest;%0A%0A%09@Before%0A%09public void beforeScenario() %7B%0A%09%09classToTest = new ClassToTest();%0A%09%7D%0A%0A%09/**%0A%09 * Scenario: Jeff returns a faulty microwave%3Cbr/%3E%0A%09 * - Given Jeff has bought a microwave for $100 %3Cbr/%3E%0A%09 * -- And he has a receipt %3Cbr/%3E%0A%09 * - When he returns the microwave %3Cbr/%3E%0A%09 * - Then Jeff should be refunded $100 %3Cbr/%3E%0A%09 */%0A%09@Test%0A%09public void test_jeff_returns_a_faulty_microwave() %7B%0A%09%09// Given%0A%09%09int amount = 100;%0A%09%09String receipt = classToTest.buy(%22microwave%22, amount);%0A%09%09// When%0A%09%09assertThat(receipt)%0A%09%09%09.isNotNull();%0A%09%09// Then%0A%09%09String refund = classToTest.returns(%22microwave%22, receipt);%0A%09%09assertThat(refund)%0A%09%09%09.isNotNull()%0A%09%09%09.contains(%22100%22);%0A%09%7D%0A%0A%7D%0A

Create B_BetterJunitTest.java