OSMO Sugar provides support for model based testing with Teemu Kanstrén's OSMO Tester.
- The
RequirementEnforcingOsmoTester
is a thin wrapper overOSMOTester
that guarantees every requirement has been met. - The
RequirementAnnotationListener
automates requirement registration and coverage. Just add@Requirement
annotations to methods that assert requirements. The defaultRequirementNamingStrategy
will prefer the value provided in the@Requirement
annotation. Otherwise, it will use the name of the annotated method.
- Add the dependency.
<dependency>
<groupId>com.agilarity</groupId>
<artifactId>osmo-sugar</artifactId>
<version>2.0.7</version>
</dependency>
- Write single step models that cover the user actions under test. Add a
Requirements
field to the model so that OSMO knows you want to track requirements. - Add a
@Requirement
annotation to each method that assures a requirement scenario has been covered. - Run your test class from your favorite testing tool, like JUnit or TestNG.
See the com.agilarity.osmo.example.vend
in the test package for a vending machine example.