From 1c00eb454f4bafc5f0f87b525699dc4efef029af Mon Sep 17 00:00:00 2001 From: Karok365 Date: Fri, 25 Oct 2024 12:41:55 +0530 Subject: [PATCH] added randomBigDecimal function to return random big decimal numbers --- src/test/java/dev/nmarulo/depensaapp/FakeTestUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/dev/nmarulo/depensaapp/FakeTestUtil.java b/src/test/java/dev/nmarulo/depensaapp/FakeTestUtil.java index 6b36ba9..ae7eb99 100644 --- a/src/test/java/dev/nmarulo/depensaapp/FakeTestUtil.java +++ b/src/test/java/dev/nmarulo/depensaapp/FakeTestUtil.java @@ -2,6 +2,7 @@ import net.datafaker.Faker; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.time.ZoneId; @@ -12,6 +13,11 @@ public final class FakeTestUtil { static { faker = new Faker(); } + + public static BigDecimal randomBigDecimal(){ + double randomValue = Math.random() * 999 + 1; + return BigDecimal.valueOf(randomValue); + } public static Integer randomInteger() { return faker.random()