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

πŸ”¨ [Refactoring] Agenda History μ‘°νšŒμ‹œ CONFIRM μƒνƒœ μΆ”κ°€ #988 #990

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
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
Loading