Skip to content

Commit

Permalink
Fix code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
enricocolasante committed Oct 13, 2022
1 parent 5702a7e commit 5ff716c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/main/java/org/hisp/dhis/utils/PredictableRandomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ public String randomNationalId() {
}

@Override
public Date randomBirthday() {
public Date randomAdultBirthday() {
return this.faker.date().birthday( 18, 80 );
}

@Override
public Date randomBirthday(int minAge, int maxAge){
return this.faker.date().birthday( minAge, maxAge );
}

@Override
public String randomLongText( int wordCount ) {
return this.faker.lorem().sentence( wordCount );
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/org/hisp/dhis/utils/Randomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ default <T> T randomElementFromList( List<T> list )
<T> List<T> randomElementsFromList(List<T> list, int size);

/**
* Returns random string containing 6 alphabetical characters.
* Returns random string.
*
* @return a String
*/
Expand Down Expand Up @@ -125,7 +125,15 @@ default <T> T randomElementFromList( List<T> list )
*
* @return a birthday date
*/
Date randomBirthday();
Date randomAdultBirthday();

/**
* Generates random birthday date with age
* between minAge and maxAge
*
* @return a birthday date
*/
Date randomBirthday(int minAge, int maxAge);

/**
* Generates random long text
Expand Down

0 comments on commit 5ff716c

Please sign in to comment.