# SimpleFunctionalTest
A JUnit extension to easily adopt functional testing and acceptance testing
In JUnit test: refactor your test in order to make it more readable by non java native speaker.
- Add comment before class or test method
- Use expressive names (camelCase or underscore) for your class, test methods and other methods
- In your test ONLY use method calls
A 'more' readable JUnit test for a non native java speaker:
...
/*
As an Account Holder
I want to withdraw cash from an ATM
So that I can get money when the bank is closed
*/
public class AccountHolderWithdrawCash {
...
@Test
public void accountHasSufficientFunds() {
givenTheAccountBalanceIs100Dollars();
andTheCardIsValid();
andTheMachineContainsEnoughMoney();
whenTheAccountHolderRequests20Dollars();
thenTheAtmShouldDispense20Dollars();
andTheAccountBalanceShouldBe80Dollars();
andTheCardShouldBeReturned();
}
private void givenTheAccountBalanceIs100Dollars(){
...
}
...
}
In your pom file: insert dependencies to SimpleFunctionalTest
<project>
...
<dependencies>
...
<dependency>
<groupId>com.github.slezier</groupId>
<artifactId>SimpleFunctionalTest</artifactId>
<version>1.8</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
and specify SimpleFunctionalTest as JUnit runner:
...
@RunWith(SimpleFunctionalTest.class)
public class AccountHolderWithdrawCash {
...
Run the test.
Open the html file generated:
Use weirds characters or specify the way is displayed.
Decorate: Table of content, breadcrumb, group fixtures, fixture displayed as table.
How to use SimpleFunctionalTest
Available release:
- 1.9: New usecase decorator: Synthesis jar doc
- 1.8: Can add new decorator, context is displayed even if failure occurs jar doc
- 1.7: Better ide integration, Fix configuration uses, add Group decorator for scenarios jar doc
- 1.6: Table decorator, @Displayable @Before @After @BeforeClass @AfterClass from FixturesHelper, preserve empty line in scenario jar doc
- 1.5: Bug fix jar doc
- 1.4: Bug fix jar doc
- 1.3: Decorators and setting jar doc
- 1.2: Using test context jar doc
- 1.1: Basic testing: UseCase Scenario Fixture SubUseCase and FixtureHelper jar doc