Skip to content

Commit fe6ae16

Browse files
Update SpotlightBatchServiceTest to return lists instead of Optionals for batch retrieval methods, enhancing compatibility with multiple QUEUED batches.
1 parent fafb525 commit fe6ae16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/gov/cabinetoffice/gap/adminbackend/services/SpotlightBatchServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ void getSpotlightBatchByMandatoryQuestionGapId_success() {
520520
final SpotlightBatch spotlightBatch = SpotlightBatch.builder().id(uuid).build();
521521

522522
when(spotlightBatchRepository.findByStatusAndSpotlightSubmissions_MandatoryQuestions_GapId(any(), any()))
523-
.thenReturn(Optional.of(spotlightBatch));
523+
.thenReturn(List.of(spotlightBatch));
524524

525525
final SpotlightBatch result = spotlightBatchService
526526
.getSpotlightBatchWithQueuedStatusByMandatoryQuestionGapId("GAP123");
@@ -531,7 +531,7 @@ void getSpotlightBatchByMandatoryQuestionGapId_success() {
531531
@Test
532532
void getSpotlightBatchByMandatoryQuestionGapId_notFound() {
533533
when(spotlightBatchRepository.findByStatusAndSpotlightSubmissions_MandatoryQuestions_GapId(any(), any()))
534-
.thenReturn(Optional.empty());
534+
.thenReturn(List.of());
535535

536536
assertThrows(NotFoundException.class,
537537
() -> spotlightBatchService.getSpotlightBatchWithQueuedStatusByMandatoryQuestionGapId("GAP123"));

0 commit comments

Comments
 (0)