milingo
2/17/2014 - 11:55 PM

Unit Tests in Java

Unit Tests in Java

// 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());
# 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"