Skip to content

Commit

Permalink
πŸ”¨ [Refactoring] Agenda History μ‘°νšŒμ‹œ CONFIRM μƒνƒœ μΆ”κ°€ #988 (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhames authored Aug 30, 2024
1 parent bf81695 commit b6da492
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Agenda addAgenda(AgendaCreateReqDto createDto, MultipartFile agendaPoster

@Transactional(readOnly = true)
public Page<Agenda> findHistoryAgendaList(Pageable pageable) {
return agendaRepository.findAllByStatusIs(AgendaStatus.FINISH, pageable);
return agendaRepository.findAllByStatusIs(AgendaStatus.FINISH, AgendaStatus.CONFIRM, pageable);
}

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ void getAgendaListHistorySuccess() {
.build()
));
Page<Agenda> agendaPage = new PageImpl<>(agendas.subList(0, 10), pageable, size);
when(agendaRepository.findAllByStatusIs(eq(AgendaStatus.FINISH), any(Pageable.class)))
when(agendaRepository.findAllByStatusIs(
eq(AgendaStatus.FINISH), eq(AgendaStatus.CONFIRM), any(Pageable.class)))
.thenReturn(agendaPage);

// when
Expand All @@ -200,7 +201,7 @@ void getAgendaListHistorySuccess() {

// then
verify(agendaRepository, times(1))
.findAllByStatusIs(AgendaStatus.FINISH, pageable);
.findAllByStatusIs(AgendaStatus.FINISH, AgendaStatus.CONFIRM, pageable);
assertThat(result.size()).isEqualTo(size);
for (int i = 1; i < result.size(); i++) {
assertThat(result.get(i).getStartTime())
Expand Down
3 changes: 2 additions & 1 deletion gg-repo/src/main/java/gg/repo/agenda/AgendaRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public interface AgendaRepository extends JpaRepository<Agenda, Long> {
@Query("SELECT a FROM Agenda a WHERE a.status = :status")
List<Agenda> findAllByStatusIs(AgendaStatus status);

Page<Agenda> findAllByStatusIs(AgendaStatus status, Pageable pageable);
@Query("SELECT a FROM Agenda a WHERE a.status = :status1 OR a.status = :status2")
Page<Agenda> findAllByStatusIs(AgendaStatus status1, AgendaStatus status2, Pageable pageable);

Optional<Agenda> findAgendaByAgendaKey(UUID usedTo);

Expand Down

0 comments on commit b6da492

Please sign in to comment.