Skip to content

Commit 0ab4b29

Browse files
committed
test: add RoomDataTableMapper for mapping room data in Cucumber tests
1 parent c35d09b commit 0ab4b29

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.soujava.demos.mongodb;
2+
3+
import io.cucumber.java.DataTableType;
4+
import org.soujava.demos.mongodb.document.Room;
5+
6+
import java.util.Map;
7+
8+
public class RoomDataTableMapper {
9+
10+
@DataTableType
11+
public Room roomEntry(Map<String, String> entry) {
12+
return Room.builder()
13+
.name(entry.get("name"))
14+
.type(RoomType.valueOf(entry.get("type")))
15+
.status(RoomStatus.valueOf(entry.get("status")))
16+
.cleanStatus(CleanStatus.valueOf(entry.get("cleanStatus")))
17+
.build();
18+
}
19+
}

0 commit comments

Comments
 (0)