悠然哈哈哈

导航

Assert.isTrue 用法

 String shippWay = "MM";

boolean expression = shippWay.equals(ShippingWayEnum.ZT.getCode());
System.out.println("Assert.isTrue报错");
 shippWay = "ZT";
 expression = shippWay.equals(ShippingWayEnum.ZT.getCode());
System.out.println(" Assert.isTrue 不报错");
String status = "600";
expression
= status.equals("600");
System.out.println("600==600  Assert.isNotTrue 报错");
BigDecimal requestQty = new BigDecimal(10);
BigDecimal total = new BigDecimal(10);
expression
= requestQty.compareTo(total) > 0 ;
System.out.println("a>b  Assert.isNotTrue 不报错");

 

posted on 2021-11-04 12:16  悠然886  阅读(2895)  评论(0编辑  收藏  举报