Skip to content

Commit e258daa

Browse files
committed
feat: refactor shouldExecuteFluentAPI to use parameterized tests for Room document insertion
1 parent d437a51 commit e258daa

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/test/java/org/soujava/demos/mongodb/document/NoSQLAPITest.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,9 @@ public static Stream<Arguments> roomsProvider() {
5151
.build()));
5252
}
5353

54-
@Test
55-
@DisplayName("Should be able to execute fluent API to create and insert a Room document")
56-
void shouldExecuteFluentAPI() {
57-
Room room = new RoomBuilder()
58-
.id("room-1")
59-
.roomNumber(101)
60-
.type(RoomType.SUITE)
61-
.status(RoomStatus.AVAILABLE)
62-
.cleanStatus(CleanStatus.CLEAN)
63-
.smokingAllowed(false)
64-
.underMaintenance(false)
65-
.build();
66-
54+
@ParameterizedTest(name = "Should be able to execute fluent API to create and insert a Room document")
55+
@MethodSource("roomsProvider")
56+
void shouldExecuteFluentAPI(Room room) {
6757
template.insert(room);
6858

6959
Stream<Room> rooms = template.select(Room.class).where(_Room.TYPE).eq(RoomType.SUITE).stream();

0 commit comments

Comments
 (0)