From fc63e494620f3a70441dd6995853f6ac270697b6 Mon Sep 17 00:00:00 2001 From: Elena Mokeeva Date: Tue, 23 Jan 2024 11:07:03 +0100 Subject: [PATCH] Close #2200 - fix the exception text for wrong classification categoeries --- .../test/java/acceptance/TaskanaConfigurationTest.java | 2 +- .../main/java/pro/taskana/TaskanaConfiguration.java | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/taskana-core-test/src/test/java/acceptance/TaskanaConfigurationTest.java b/lib/taskana-core-test/src/test/java/acceptance/TaskanaConfigurationTest.java index 21e5d2e272..370690d6b9 100644 --- a/lib/taskana-core-test/src/test/java/acceptance/TaskanaConfigurationTest.java +++ b/lib/taskana-core-test/src/test/java/acceptance/TaskanaConfigurationTest.java @@ -961,7 +961,7 @@ void should_ThrowInvalidArgumentEx_When_ClassificationTypesDoesNotExist() { "Parameter classificationCategoriesByType " + "(taskana.classification.categories.) " + "contains invalid Classification Types." - + " configured: [VALID] detected: [DOES_NOT_EXIST]"); + + " configured: [VALID] existing: [DOES_NOT_EXIST]"); } @Test diff --git a/lib/taskana-core/src/main/java/pro/taskana/TaskanaConfiguration.java b/lib/taskana-core/src/main/java/pro/taskana/TaskanaConfiguration.java index 321d1129c6..0a8b8bff9f 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/TaskanaConfiguration.java +++ b/lib/taskana-core/src/main/java/pro/taskana/TaskanaConfiguration.java @@ -1055,7 +1055,6 @@ public Builder enforceServiceLevel(boolean enforceServiceLevel) { this.enforceServiceLevel = enforceServiceLevel; return this; } - // endregion // region authentication configuration @@ -1447,12 +1446,11 @@ private void validateConfiguration() { if (!new HashSet<>(classificationTypes) .containsAll(classificationCategoriesByType.keySet())) { throw new InvalidArgumentException( - String.format( "Parameter classificationCategoriesByType (taskana.classification.categories.)" - + " contains invalid Classification Types. " - + "configured: %s " - + "detected: %s", - classificationTypes, classificationCategoriesByType.keySet())); + + " is configured incorrectly. Please check whether all specified Classification" + + " Types exist. Additionally, check whether the correct separator is used in" + + " the property taskana.classification.types ." + ); } if (!classificationCategoriesByType.keySet().containsAll(classificationTypes)) {