feat(loader): per-room music field + demo rooms.yaml entries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 22:58:13 +02:00
parent a38bb6e4f3
commit 35ad4e6f1a
5 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
package thb.jeanluc.adventure.loader;
import org.junit.jupiter.api.Test;
import thb.jeanluc.adventure.loader.dto.RoomDto;
import thb.jeanluc.adventure.model.Room;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
class RoomMusicTest {
@Test
void musicFieldIsCarriedOntoRoom() {
RoomDto dto = new RoomDto("r", "Room", "d",
Map.of(), List.of(), List.of(), null, null, null, "theme.ogg");
Room room = RoomFactory.shellFromDto(dto);
assertThat(room.getMusic()).isEqualTo("theme.ogg");
}
@Test
void absentMusicIsNull() {
RoomDto dto = new RoomDto("r", "Room", "d", Map.of(), List.of(), List.of());
Room room = RoomFactory.shellFromDto(dto);
assertThat(room.getMusic()).isNull();
}
}