naver / fixture-monkey

Let Fixture Monkey generate test instances including edge cases automatically
https://naver.github.io/fixture-monkey
Apache License 2.0
560 stars 89 forks source link

BigDemical에 대한 값 생성 오류 #1042

Open sunwon12 opened 3 weeks ago

sunwon12 commented 3 weeks ago

Describe the bug

Describe your issue here. 오류: image

설정: image image image

보시다시피 fixtureMonkey에 대한 특별한 설정을 주지 않았습니다. 그런데 BigDemical이 값을 잘못 생성할 때도 있습니다.

Your environment

Steps to reproduce

Tell us how to reproduce this issue. Or provide us an example repository to check the bug It would be very helpful if you could tell us the seed of the given test, which is provided in fixture-monkey-junit-jupiter module

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

seongahjo commented 3 weeks ago

@sunwon12 안녕하세요.

주신 에러메세지를 봤을 때는 BigDecimal 생성에 문제가 있는 게 아니라 데이터베이스에서 정해놓은 크기보다 더 큰 값이 생성되고 있어 문제가 되고 있는 것으로 보입니다.

아래와 같이 SimplevalueJqwikPlugin()을 추가하시는 걸 권장드립니다.

  FixtureMonkey.builder()
      .plugin(new SimpleValueJqwikPlugin())
      .build()

혹은 다음 옵션을 사용해서 BigDecimal 생성 범위를 제한하시는 방법도 있습니다. 참조 문서

감사합니다.