diff --git a/api/src/main/java/ca/bc/gov/educ/penreg/api/orchestrator/BaseReturnFilesOrchestrator.java b/api/src/main/java/ca/bc/gov/educ/penreg/api/orchestrator/BaseReturnFilesOrchestrator.java index 6d2952f0..c3b6198c 100644 --- a/api/src/main/java/ca/bc/gov/educ/penreg/api/orchestrator/BaseReturnFilesOrchestrator.java +++ b/api/src/main/java/ca/bc/gov/educ/penreg/api/orchestrator/BaseReturnFilesOrchestrator.java @@ -287,7 +287,7 @@ protected List getStudentRegistrationContactsByMincode(final PenR return this.getStudentRegistrationContactService().getStudentRegistrationContactsByMincode(penRequestBatchEntity.getMincode()); } catch (final NullPointerException e) { log.error("Error while trying to get get student registration contact. The student registration contact map is null", e); - return null; + return Collections.emptyList(); } } diff --git a/api/src/test/java/ca/bc/gov/educ/penreg/api/rest/RestUtilsTest.java b/api/src/test/java/ca/bc/gov/educ/penreg/api/rest/RestUtilsTest.java index 701c1f7f..30612bd2 100644 --- a/api/src/test/java/ca/bc/gov/educ/penreg/api/rest/RestUtilsTest.java +++ b/api/src/test/java/ca/bc/gov/educ/penreg/api/rest/RestUtilsTest.java @@ -245,7 +245,7 @@ public void testGetStudentRegistrationContacts_shouldReturnData() { when(this.responseMock.bodyToFlux(SchoolContactSearchWrapper.class)).thenReturn(Flux.just(createSchoolContactSearchWrapper())); final var result = this.restUtils.getStudentRegistrationContactList("10200001"); - assertThat(result.size()).isEqualTo(2); + assertThat(result).hasSize(2); assertThat(result.get(0).getEmail()).isEqualTo("pen@email.com"); assertThat(result.get(0).getFirstName()).isEqualTo("Joe"); assertThat(result.get(1).getEmail()).isEqualTo("2@email.com");