Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@JsonFormat 추가 #800

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.votogether.domain.notice.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.votogether.domain.notice.entity.Notice;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
Expand All @@ -22,9 +23,11 @@ public record NoticeResponse(
String content,

@Schema(description = "공지사항 배너 마감기한", example = "2023-12-25 23:59")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
LocalDateTime deadline,

@Schema(description = "공지사항 생성시각", example = "2023-12-25 23:59")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
LocalDateTime createdAt
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.votogether.test.ControllerTest;
import io.restassured.module.mockmvc.RestAssuredMockMvc;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand Down Expand Up @@ -52,8 +53,8 @@ void getProgressNotice() throws Exception {
"bannerTitle",
"bannerSubtitle",
"content",
LocalDateTime.now().plusDays(1),
LocalDateTime.now()
LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.MINUTES),
LocalDateTime.now().truncatedTo(ChronoUnit.MINUTES)
);
given(noticeQueryService.getProgressNotice()).willReturn(expected);

Expand Down Expand Up @@ -86,8 +87,8 @@ void getNotices() throws Exception {
"bannerTitle",
"bannerSubtitle",
"content",
LocalDateTime.now().plusDays(1),
LocalDateTime.now()
LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.MINUTES),
LocalDateTime.now().truncatedTo(ChronoUnit.MINUTES)
);
NoticePageResponse expected = new NoticePageResponse(1, 0, List.of(noticeResponse));
given(noticeQueryService.getNotices(anyInt())).willReturn(expected);
Expand Down Expand Up @@ -153,8 +154,8 @@ void getNotice() throws Exception {
"bannerTitle",
"bannerSubtitle",
"content",
LocalDateTime.now().plusDays(1),
LocalDateTime.now()
LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.MINUTES),
LocalDateTime.now().truncatedTo(ChronoUnit.MINUTES)
);
given(noticeQueryService.getNotice(anyLong())).willReturn(expected);

Expand Down