I have these values coming from a test
previousTokenValues[1] = "1378994409108"
currentTokenValues[1] = "1378994416509"
and I try
// current timestamp is greater
assertTrue(Long.parseLong(previousTokenValues[1]) > Long.parseLong(currentTokenValues[1]));
I get the java.lang.AssertionError
and detailMessage
on debugging is null
.
How can I assert greater than conditions in using JUnit
You should add Hamcrest-library to your Build Path. It contains the needed Matchers.class which has the lessThan() method.
Dependency as below.