From a34d56dfa8ab69a01ff2fc00cff5ec38083d60e5 Mon Sep 17 00:00:00 2001 From: Kevin Pontes Date: Mon, 6 Jul 2020 10:11:59 +0200 Subject: [PATCH 1/2] Implementation effort is not worth the benefit --- .../assembly/appconfig/validation/ValidationError.java | 3 +-- .../validation/ExposureConfigurationValidatorTest.java | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ValidationError.java b/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ValidationError.java index 4ad256e314..7732d5ac1c 100644 --- a/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ValidationError.java +++ b/services/distribution/src/main/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ValidationError.java @@ -79,7 +79,6 @@ public enum ErrorType { VALUE_OUT_OF_BOUNDS, INVALID_URL, INVALID_PARTITIONING, - TOO_MANY_DECIMAL_PLACES, - MISSING_ENTRY + TOO_MANY_DECIMAL_PLACES } } diff --git a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ExposureConfigurationValidatorTest.java b/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ExposureConfigurationValidatorTest.java index dda3c9f051..ba655d3b49 100644 --- a/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ExposureConfigurationValidatorTest.java +++ b/services/distribution/src/test/java/app/coronawarn/server/services/distribution/assembly/appconfig/validation/ExposureConfigurationValidatorTest.java @@ -22,7 +22,6 @@ import static app.coronawarn.server.services.distribution.assembly.appconfig.validation.ExposureConfigurationValidator.CONFIG_PREFIX; import static app.coronawarn.server.services.distribution.assembly.appconfig.validation.RiskScoreClassificationValidatorTest.buildError; -import static app.coronawarn.server.services.distribution.assembly.appconfig.validation.ValidationError.ErrorType.MISSING_ENTRY; import static app.coronawarn.server.services.distribution.assembly.appconfig.validation.ValidationError.ErrorType.TOO_MANY_DECIMAL_PLACES; import static app.coronawarn.server.services.distribution.assembly.appconfig.validation.ValidationError.ErrorType.VALUE_OUT_OF_BOUNDS; import static org.assertj.core.api.Assertions.assertThat; @@ -69,8 +68,6 @@ private static Stream createOkTests() { private static Stream createFailedTests() { return Stream.of( ScoreTooHigh(), - // TODO cwa-server/#320 Validate that no attributes are missing in .yaml - // ScoreNegative(), WeightNegative(), WeightTooHigh() ).map(Arguments::of); @@ -103,12 +100,6 @@ public static TestWithExpectedResult WeightTooHigh() { .with(buildError(CONFIG_PREFIX + "transmission", 101d, VALUE_OUT_OF_BOUNDS)); } - public static TestWithExpectedResult ScoreNegative() { - return new TestWithExpectedResult("score_negative.yaml") - .with(buildError(CONFIG_PREFIX + "transmission.appDefined1", RiskLevel.UNRECOGNIZED, VALUE_OUT_OF_BOUNDS)) - .with(buildError(CONFIG_PREFIX + "transmission.appDefined3", null, MISSING_ENTRY)); - } - public static TestWithExpectedResult ScoreTooHigh() { return new TestWithExpectedResult("score_too_high.yaml") .with(buildError(CONFIG_PREFIX + "transmission.appDefined1", RiskLevel.UNRECOGNIZED, VALUE_OUT_OF_BOUNDS)) From 7bfd04be60a37863d13e036734a185640fbba298 Mon Sep 17 00:00:00 2001 From: Kevin Pontes Date: Mon, 6 Jul 2020 10:27:24 +0200 Subject: [PATCH 2/2] Deleted score negative test --- .../resources/parameters/score_negative.yaml | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 services/distribution/src/test/resources/parameters/score_negative.yaml diff --git a/services/distribution/src/test/resources/parameters/score_negative.yaml b/services/distribution/src/test/resources/parameters/score_negative.yaml deleted file mode 100644 index 9367ba9231..0000000000 --- a/services/distribution/src/test/resources/parameters/score_negative.yaml +++ /dev/null @@ -1,44 +0,0 @@ -transmission_weight: 100 -duration_weight: 50 -attenuation_weight: 80 - - -transmission: - app_defined_1: -2 # not ok, negative - app_defined_2: 0 - #app_defined_3: 3 # not ok (missing -> unspecified) - app_defined_4: 5 - app_defined_5: 5 - app_defined_6: 6 - app_defined_7: 7 - app_defined_8: 8 - -duration: - eq_0_min: 1 - gt_0_le_5_min: 2 - gt_5_le_10_min: 3 - gt_10_le_15_min: 4 - gt_15_le_20_min: 5 - gt_20_le_25_min: 6 - gt_25_le_30_min: 7 - gt_30_min: 8 - -days_since_last_exposure: - ge_14_days: 1 - ge_12_lt_14_days: 2 - ge_10_lt_12_days: 3 - ge_8_lt_10_days: 4 - ge_6_lt_8_days: 5 - ge_4_lt_6_days: 6 - ge_2_lt_4_days: 7 - ge_0_lt_2_days: 8 - -attenuation: - gt_73_dbm: 1 - gt_63_le_73_dbm: 2 - gt_51_le_63_dbm: 3 - gt_33_le_51_dbm: 4 - gt_27_le_33_dbm: 5 - gt_15_le_27_dbm: 6 - gt_10_le_15_dbm: 7 - lt_10_dbm: 8