Skip to content

Commit 3a7842c

Browse files
committed
feat: update room repository to use string instead of type
Signed-off-by: Otavio Santana <[email protected]>
1 parent 422fc99 commit 3a7842c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/org/soujava/demos/mongodb/document/RoomRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ public interface RoomRepository {
3030
void deleteBy();
3131

3232
@Query("WHERE type = :type")
33-
List<Room> findByType(@Param("type") RoomType type);
33+
List<Room> findByType(@Param("type") String type);
3434
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void cleanUp() {
117117
@ParameterizedTest(name = "should find rooms by type {0}")
118118
@EnumSource(RoomType.class)
119119
void shouldFindRoomByType(RoomType type) {
120-
List<Room> rooms = this.repository.findByType(type);
120+
List<Room> rooms = this.repository.findByType(type.name());
121121
SoftAssertions.assertSoftly(softly -> softly.assertThat(rooms).allMatch(room -> room.getType().equals(type)));
122122
}
123123

0 commit comments

Comments
 (0)