From bc9a01cc362eb4c6c32530abe120abfa596c75f7 Mon Sep 17 00:00:00 2001 From: Ryan Amari Date: Wed, 1 May 2024 10:25:41 -0400 Subject: [PATCH] ALS-6375: Do not show 0 for obfuscated search results --- .../hms/dbmi/avillach/AggregateDataSharingResourceRS.java | 2 +- .../avillach/AggregateDataSharingResourceRSAcceptanceTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java index 60b62b5c..c3cd2be3 100644 --- a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java +++ b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java @@ -765,7 +765,7 @@ private Stream generateParents(String key) { private Optional aggregateCount(String actualCount) { try { int queryResult = Integer.parseInt(actualCount); - if (queryResult > 0 && queryResult < threshold) { + if (queryResult < threshold) { return Optional.of("< " + threshold); } } catch (NumberFormatException nfe) { diff --git a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/test/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRSAcceptanceTests.java b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/test/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRSAcceptanceTests.java index 59bddec9..2e88e02b 100644 --- a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/test/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRSAcceptanceTests.java +++ b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/test/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRSAcceptanceTests.java @@ -90,7 +90,7 @@ public void testNoObfuscationOnLargeCounts() throws IOException { @Test public void testZeroNotObfuscated() throws IOException { - expect_original_result_to_become_obfuscated_result("all_zero_open_access_cross_count_result", "all_zero_open_access_cross_count_result"); + expect_original_result_to_become_obfuscated_result("all_zero_open_access_cross_count_result", "obfuscated_all_less_ten_open_access_cross_count_result"); } @Test