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

날짜, 시간 관련 코드 수정 (DateTimeService, attendanceDateTime field) #107

Merged
merged 9 commits into from
Jul 1, 2024

Conversation

redcarrot1
Copy link
Member

  • LocalDateTime.now() 또는 LocalDate.now()를 직접 사용할 시 테스트하기 어려운 코드가 되기 때문에, Mocking이 가능하도록 중간 컴포넌트를 추가
// before
LocalDateTime now = LocalDateTime.now();

// after
@Autowired
private DateTimeService;

LocalDateTime now = DateTimeService.getLocalDateTimeNow();
  • 출석 날짜, 시각 정보를 JpaAuditing 에 기반하여 판단했었음. mocking이 가능하지만 테스트 코드가 복잡해지고 읽기 어려운 코드가 되므로, 별도의 필드를 추가하여 사용

@redcarrot1 redcarrot1 added the feature New feature or request label Jul 1, 2024
@redcarrot1 redcarrot1 self-assigned this Jul 1, 2024
@redcarrot1 redcarrot1 merged commit 698da7a into develop Jul 1, 2024
1 check passed
@redcarrot1 redcarrot1 deleted the feat/DateTimeService branch July 1, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant