Skip to content

Commit

Permalink
chore: 이미지 URL에 작은 따옴표 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
kmebin committed Nov 28, 2023
1 parent 39e3d7b commit db2b379
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/com/moabam/api/domain/room/Room.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public class Room extends BaseTimeEntity {
private static final int LEVEL_10 = 10;
private static final int LEVEL_20 = 20;
private static final int LEVEL_30 = 30;
private static final String ROOM_LEVEL_0_IMAGE = "'https://image.moabam.com/moabam/default/room-level-00.png'";
private static final String ROOM_LEVEL_5_IMAGE = "'https://image.moabam.com/moabam/default/room-level-05.png'";
private static final String ROOM_LEVEL_10_IMAGE = "'https://image.moabam.com/moabam/default/room-level-10.png'";
private static final String ROOM_LEVEL_20_IMAGE = "'https://image.moabam.com/moabam/default/room-level-20.png'";
private static final String ROOM_LEVEL_30_IMAGE = "'https://image.moabam.com/moabam/default/room-level-30.png'";
private static final String ROOM_LEVEL_0_IMAGE = "https://image.moabam.com/moabam/default/room-level-00.png";
private static final String ROOM_LEVEL_5_IMAGE = "https://image.moabam.com/moabam/default/room-level-05.png";
private static final String ROOM_LEVEL_10_IMAGE = "https://image.moabam.com/moabam/default/room-level-10.png";
private static final String ROOM_LEVEL_20_IMAGE = "https://image.moabam.com/moabam/default/room-level-20.png";
private static final String ROOM_LEVEL_30_IMAGE = "https://image.moabam.com/moabam/default/room-level-30.png";
private static final int MORNING_START_TIME = 4;
private static final int MORNING_END_TIME = 10;
private static final int NIGHT_START_TIME = 20;
Expand Down Expand Up @@ -78,7 +78,7 @@ public class Room extends BaseTimeEntity {
@Column(name = "announcement", length = 100)
private String announcement;

@ColumnDefault(ROOM_LEVEL_0_IMAGE)
@ColumnDefault("'" + ROOM_LEVEL_0_IMAGE + "'")
@Column(name = "room_image", length = 500)
private String roomImage;

Expand Down
20 changes: 20 additions & 0 deletions src/test/java/com/moabam/api/domain/room/RoomTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.moabam.global.error.exception.BadRequestException;
import com.moabam.global.error.model.ErrorMessage;
import com.moabam.support.fixture.RoomFixture;

class RoomTest {

Expand Down Expand Up @@ -88,4 +89,23 @@ void night_time_validate_exception(int certifyTime) {
.isInstanceOf(BadRequestException.class)
.hasMessage(ErrorMessage.INVALID_REQUEST_FIELD.getMessage());
}

@DisplayName("레벨에 따른 이미지 업데이트")
@ParameterizedTest
@CsvSource({
"5, https://image.moabam.com/moabam/default/room-level-05.png",
"10, https://image.moabam.com/moabam/default/room-level-10.png",
"20, https://image.moabam.com/moabam/default/room-level-20.png",
"30, https://image.moabam.com/moabam/default/room-level-30.png",
})
void update_room_image_success(int level, String image) {
// given
Room room = RoomFixture.room();

// when
room.upgradeRoomImage(level);

// then
assertThat(room.getRoomImage()).isEqualTo(image);
}
}

0 comments on commit db2b379

Please sign in to comment.