Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
yhames committed Aug 30, 2024
1 parent 9b9230b commit 1887495
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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
2 changes: 0 additions & 2 deletions gg-repo/src/main/java/gg/repo/agenda/AgendaRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ 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);

Expand Down

0 comments on commit 1887495

Please sign in to comment.