How to assert greater than using JUnit Assert?

前端 未结 8 828
你的背包
你的背包 2020-12-25 09:04

I have these values coming from a test

previousTokenValues[1] = \"1378994409108\"
currentTokenValues[1] = \"1378994416509\"

and I try

8条回答
  •  醉梦人生
    2020-12-25 09:55

    you can also try below simple soln:

    previousTokenValues[1] = "1378994409108";
    currentTokenValues[1] = "1378994416509";
    
    Long prev = Long.parseLong(previousTokenValues[1]);
    Long curr = Long.parseLong(currentTokenValues[1]);
    
    Assert.assertTrue(prev  > curr );   
    

提交回复
热议问题