DiUS / java-faker

Brings the popular ruby faker gem to Java
http://dius.github.io/java-faker
Other
4.77k stars 851 forks source link

The faker.date() method returns different dates when using seed #769

Closed remMirakl closed 11 months ago

remMirakl commented 11 months ago

Describe the bug When using a seed, the faker.date() method returns different dates. Indeed, the faker.date() seems to use the current date to generate a random date. So when the method is used another day, the result will be different. This behavior can break tests.

To Reproduce You can easily reproduce this bug by using a seed and use the faker.date() in a simple test that checks the date returned by the method.

Expected behavior If you launch the test another day that the day you created it, the test will fail since the date returned will not be the same.

bodiam commented 11 months ago

This is a known issue, and is fixed in Datafaker

remMirakl commented 11 months ago

Thank you for your answer!