From 8880c4e175165ebe938cc635dac479a7163d80e6 Mon Sep 17 00:00:00 2001 From: Paul McPhee Date: Mon, 29 Jul 2024 13:43:59 +0100 Subject: [PATCH] PI-2391: Fixed issues with missing test data --- .../uk/gov/justice/digital/hmpps/ProxyIntegrationTest.kt | 3 ++- .../digital/hmpps/api/proxy/CommunityApiController.kt | 8 ++++---- .../justice/digital/hmpps/api/proxy/CompareAllReport.kt | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ProxyIntegrationTest.kt b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ProxyIntegrationTest.kt index adc47dbfce..890df1c8c0 100644 --- a/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ProxyIntegrationTest.kt +++ b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ProxyIntegrationTest.kt @@ -282,8 +282,9 @@ internal class ProxyIntegrationTest { .withToken() ).andExpect(status().is2xxSuccessful).andReturn().response.contentAsJson() - assertThat(res.totalNumberOfRequests, equalTo(4)) + assertThat(res.totalNumberOfRequests, equalTo(0)) assertThat(res.totalNumberOfCrns, equalTo(2)) assertThat(res.currentPageNumber, equalTo(2)) + assertThat(res.unableToBeExecuted, equalTo(4)) } } diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CommunityApiController.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CommunityApiController.kt index 6bb921bdeb..2f40d267ba 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CommunityApiController.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CommunityApiController.kt @@ -160,17 +160,17 @@ class CommunityApiController( .map(CompletableFuture::join) .collect(Collectors.toList()) } - val unsuccessful = reports.filter { !it.success } - val executionFailures = reports.filter { it.testExecuted == false } + val unsuccessful = reports.filter { !it.success && it.testExecuted == true } + val executionFailures = reports.filter { it.testExecuted == false }.size return CompareAllReport( totalNumberOfCrns = personList.totalElements.toInt(), totalPages = pageable.pageSize, currentPageNumber = compare.pageNumber, - totalNumberOfRequests = reports.size, + totalNumberOfRequests = reports.size - executionFailures, numberOfSuccessfulRequests = reports.size - unsuccessful.size, numberOfUnsuccessfulRequests = unsuccessful.size, - executionFailures = executionFailures, + unableToBeExecuted = executionFailures, failureReports = reports.filter { !it.success && it.testExecuted == true } ) } diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CompareAllReport.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CompareAllReport.kt index 060f504753..62f8e41733 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CompareAllReport.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/proxy/CompareAllReport.kt @@ -7,6 +7,6 @@ data class CompareAllReport( val totalNumberOfRequests: Int, val numberOfSuccessfulRequests: Int, val numberOfUnsuccessfulRequests: Int, - val executionFailures: List, + val unableToBeExecuted: Int, val failureReports: List, )