NaluKit/iban4g

Allow setting a custom Random

Closed this issue · 1 comments

Form arturmkrtchyan/iban4j#91

I'm using Kotest property based testing, and this needs a deterministic way of generating random data based on a seed, or existing Random instance.

iban4j can generate random IBANs, but I can't set a seed or pass in a Random instance.

I would like to add an overload for the 'Iban.random()method that will accept aRandom` parameter.

I can try making a PR for this, if you agree. Thanks!


Allow passing in a custom random, so users can make the generation deterministic.

resolves arturmkrtchyan/iban4j#91 based on arturmkrtchyan/iban4j#93

Summary

  • fix spelling mistake in test, ibanContruction -> ibanConstruction
  • add toString() to BbanStructureEntry.java (this helps the test error messages)
  • tests to check if randomness is deterministic
  • add additional tests for validity of BbanStructureEntry.java