package com.zipcoder.payment; import org.junit.Assert; import org.junit.Test; public class CompareToTest { @Test public void testSameDescCompare(){ Check check = new Check(); check.setName("Jonathan"); check.setAccount("1039340954092"); check.setRouting("304940392043"); check.setId(10L); PayPal paypal = new PayPal(); paypal.setName("Jonathan"); paypal.setEmail("Jonathan@Jonathan.com"); paypal.setId(10L); int acutal = paypal.compareTo(check); Assert.assertTrue(acutal > 0); } @Test public void testCompareName(){ PaymentSortByPayer sort = new PaymentSortByPayer(); Check check = new Check(); check.setName("Hinds"); check.setAccount("1039340954092"); check.setRouting("304940392043"); check.setId(10L); PayPal paypal = new PayPal(); paypal.setName("Hinds"); paypal.setEmail("Jonathan@Jonathan.com"); paypal.setId(10L); int acutal = sort.compare(paypal, check); Assert.assertTrue(acutal == 0); } }