sonar fix - add assert commands in CommanderTest

This commit is contained in:
atayal
2021-11-03 22:24:15 +05:30
parent 4360dfc4cd
commit 3a6899ca4f

View File

@@ -12,6 +12,9 @@ import com.iluwatar.commander.shippingservice.ShippingDatabase;
import com.iluwatar.commander.shippingservice.ShippingService; import com.iluwatar.commander.shippingservice.ShippingService;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.platform.commons.util.StringUtils;
import static org.junit.jupiter.api.Assertions.assertFalse;
class CommanderTest { class CommanderTest {
@@ -82,6 +85,7 @@ class CommanderTest {
Commander c = buildCommanderObject(); Commander c = buildCommanderObject();
var order = new Order(new User("K", "J"), "pen", 1f); var order = new Order(new User("K", "J"), "pen", 1f);
c.placeOrder(order); c.placeOrder(order);
assertFalse(StringUtils.isBlank(order.id));
} }
@Test @Test
@@ -89,6 +93,7 @@ class CommanderTest {
Commander c = buildCommanderObjectWithoutPaymentDB(); Commander c = buildCommanderObjectWithoutPaymentDB();
var order = new Order(new User("K", null), "pen", 1f); var order = new Order(new User("K", null), "pen", 1f);
c.placeOrder(order); c.placeOrder(order);
assertFalse(StringUtils.isBlank(order.id));
} }
@Test @Test
@@ -96,5 +101,6 @@ class CommanderTest {
Commander c = buildCommanderObjectWithoutPaymentDB(true); Commander c = buildCommanderObjectWithoutPaymentDB(true);
var order = new Order(new User("K", null), "pen", 1f); var order = new Order(new User("K", null), "pen", 1f);
c.placeOrder(order); c.placeOrder(order);
assertFalse(StringUtils.isBlank(order.id));
} }
} }