Skip to content

Instantly share code, notes, and snippets.

@milingo
Last active May 29, 2017 11:01
Show Gist options
  • Save milingo/9061765 to your computer and use it in GitHub Desktop.
Save milingo/9061765 to your computer and use it in GitHub Desktop.
Unit Tests in Java
# Run only failed test on cucumber
mvn test -Dcucumber.options="@target/cucumber-failed.txt"
# Run only a feature on cucumber
mvn clean test -Dcucumber.options="/path/to/feature:37"
or
mvn clean test -Dcucumber.options="--tags @NonGeoLocatedBid"
// Make assertions over parameters of a method call on a unit test with mockito
ArgumentCaptor<EventData> model = ArgumentCaptor.forClass(EventData.class);
verify(adEventDAOMock).save(eq(request.getBid()), model.capture());
assertFalse(model.getValue().getGeohash().isEmpty());
assertFalse(model.getValue().getEvents().isEmpty());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment