Skip to content

Commit c70509d

Browse files
author
Rupert Westenthaler
committed
adapted the test to reflect the changed calls to the occurredObservationService.getLatestStartTime(..) methods
1 parent 152ed94 commit c70509d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

studymanager-services/src/test/java/io/redlink/more/studymanager/scheduling/UpsertOccurredObservationsCronTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void testUpsert() {
200200

201201

202202
//finally moch the two methods used in the occurredObservationService
203-
when(occurredObservationService.getLatestStartTime(anyLong()))
203+
when(occurredObservationService.getLatestStartTime(anyLong(), anyInt()))
204204
.thenReturn(lastOoTimestamp);
205205

206206
when(occurredObservationService.upsert(anyLong(), anyInt(), anyInt(), any(), any()))
@@ -219,9 +219,11 @@ public void testUpsert() {
219219

220220
//verify the the #getLatestStartTime(..) method is called for each study once
221221
ArgumentCaptor<Long> studyIdCaptor = ArgumentCaptor.forClass(Long.class);
222-
verify(occurredObservationService, times(2))
223-
.getLatestStartTime(studyIdCaptor.capture());
222+
ArgumentCaptor<Integer> participantIdCaptor = ArgumentCaptor.forClass(Integer.class);
223+
verify(occurredObservationService, times(5))
224+
.getLatestStartTime(studyIdCaptor.capture(), participantIdCaptor.capture());
224225
assertThat(studyIdCaptor.getAllValues()).contains(1L, 2L);
226+
assertThat(participantIdCaptor.getAllValues()).contains(1,2,3,1,2);
225227

226228
ArgumentCaptor<Long> ooStudyIdCaptor = ArgumentCaptor.forClass(Long.class);
227229
ArgumentCaptor<Integer> ooObservationIdCaptor = ArgumentCaptor.forClass(Integer.class);

0 commit comments

Comments
 (0)