Skip to content

Commit

Permalink
test: Diary 컨트롤러/서비스/리파지토리/도메인 테스트 코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
peeerr committed Nov 6, 2024
1 parent d6d2513 commit 4a9b1be
Show file tree
Hide file tree
Showing 10 changed files with 1,478 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public ResponseEntity<SuccessResponse<Void>> createDiaryManual(
@Parameter(description = "인증된 사용자 정보", hidden = true)
@AuthenticationPrincipal MemberDetails memberDetails,
@Parameter(description = "수기 일기 작성 정보", required = true)
@RequestBody DiaryManualCreateRequest diaryManualCreateRequest) {
@RequestBody @Valid DiaryManualCreateRequest diaryManualCreateRequest) {
Long memberId = memberDetails.getId();
diaryService.createDiaryManual(memberId, diaryManualCreateRequest);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.potatocake.everymoment.dto.request;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Getter
public class CategoryRequest {
private Long categoryId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class CommentRequest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.potatocake.everymoment.dto.request;

import com.potatocake.everymoment.dto.LocationPoint;
import lombok.Builder;
import lombok.Getter;

@Builder
@Getter
public class DiaryAutoCreateRequest {
private LocationPoint locationPoint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.potatocake.everymoment.dto.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.potatocake.everymoment.dto.LocationPoint;
import jakarta.validation.constraints.Size;
import java.util.List;
import lombok.Builder;
import lombok.Getter;

@Builder
@Getter
public class DiaryManualCreateRequest {

Expand All @@ -18,7 +21,10 @@ public class DiaryManualCreateRequest {
@Size(max = 250, message = "주소는 250자를 초과할 수 없습니다")
private String address;

@JsonProperty("bookmark")
private boolean isBookmark;

@JsonProperty("public")
private boolean isPublic;

@Size(max = 10, message = "이모지는 10자를 초과할 수 없습니다")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

import jakarta.validation.constraints.Size;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Builder
@NoArgsConstructor
@AllArgsConstructor
@Getter
public class DiaryPatchRequest {

Expand Down
Loading

0 comments on commit 4a9b1be

Please sign in to comment.