Skip to content

Commit

Permalink
implemented the function in ShoppingListServiceTestUtil and ProductSe…
Browse files Browse the repository at this point in the history
…rviceTestUtil
  • Loading branch information
KaroK365 committed Oct 25, 2024
1 parent 1c00eb4 commit 863c81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collections;

@Getter
Expand Down Expand Up @@ -69,9 +66,9 @@ private static Product initProduct() {

product.setId(FakeTestUtil.randomLong());
product.setName(FakeTestUtil.randomWord());
product.setPrice(BigDecimal.ZERO);
product.setPrice(FakeTestUtil.randomBigDecimal());
product.setImgUrl(FakeTestUtil.randomImage());
product.setCalories(BigDecimal.ZERO);
product.setCalories(FakeTestUtil.randomBigDecimal());
product.setDescription(FakeTestUtil.randomSentence());
product.setCreatedAt(FakeTestUtil.randomPast());
product.setUpdatedAt(FakeTestUtil.randomFuture());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collections;

@Getter
Expand Down Expand Up @@ -48,8 +46,8 @@ private ShoppingList initShoppingList(User user) {
shoppingList.setId(FakeTestUtil.randomInteger());
shoppingList.setName(FakeTestUtil.randomSentence());
shoppingList.setTotalProducts(0);
shoppingList.setTotalCalories(BigDecimal.ZERO);
shoppingList.setTotalPrice(BigDecimal.ZERO);
shoppingList.setTotalCalories(FakeTestUtil.randomBigDecimal());
shoppingList.setTotalPrice(FakeTestUtil.randomBigDecimal());
shoppingList.setCreatedAt(FakeTestUtil.randomPast());
shoppingList.setUpdatedAt(FakeTestUtil.randomFuture());
shoppingList.setProductHasShoppingList(Collections.emptySet());
Expand Down

0 comments on commit 863c81b

Please sign in to comment.