File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/test/java/org/soujava/demos/mongodb/document Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11package org .soujava .demos .mongodb .document ;
22
33import net .datafaker .Faker ;
4+ import org .junit .jupiter .params .provider .Arguments ;
45
56import java .util .UUID ;
67import java .util .concurrent .ThreadLocalRandom ;
8+ import java .util .stream .Stream ;
79
810final class RoomFaker {
911
@@ -20,10 +22,14 @@ static Room getRoom() {
2022 .build ();
2123 }
2224
23-
2425 static <T extends Enum <?>> T randomEnum (Class <T > enumClass ) {
2526 T [] constants = enumClass .getEnumConstants ();
2627 int index = ThreadLocalRandom .current ().nextInt (constants .length );
2728 return constants [index ];
2829 }
30+
31+ static Stream <Arguments > room () {
32+ return Stream .of (Arguments .of (RoomFaker .getRoom (), Arguments .of (RoomFaker .getRoom (),
33+ Arguments .of (RoomFaker .getRoom ()))));
34+ }
2935}
Original file line number Diff line number Diff line change @@ -178,8 +178,7 @@ void shouldFindRoomsNeedingCleaning() {
178178 }
179179
180180 static Stream <Arguments > room () {
181- return Stream .of (Arguments .of (RoomFaker .getRoom (), Arguments .of (RoomFaker .getRoom (),
182- Arguments .of (RoomFaker .getRoom ()))));
181+ return RoomFaker .room ();
183182 }
184183
185184}
You can’t perform that action at this time.
0 commit comments