From 368b508e6a08aefcac46ddfb44ec3f2bf6d84827 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 | 10 ++++++---- .../main/java/pro/taskana/TaskanaConfiguration.java | 10 ++++------ 2 files changed, 10 insertions(+), 10 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..6174e69463 100644 --- a/lib/taskana-core-test/src/test/java/acceptance/TaskanaConfigurationTest.java +++ b/lib/taskana-core-test/src/test/java/acceptance/TaskanaConfigurationTest.java @@ -958,10 +958,12 @@ void should_ThrowInvalidArgumentEx_When_ClassificationTypesDoesNotExist() { assertThatThrownBy(call) .isInstanceOf(InvalidArgumentException.class) .hasMessageContaining( - "Parameter classificationCategoriesByType " - + "(taskana.classification.categories.) " - + "contains invalid Classification Types." - + " configured: [VALID] detected: [DOES_NOT_EXIST]"); + "Parameter classificationCategoriesByType" + + " (taskana.classification.categories.) 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 ." + ); } @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..d6b5216d47 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)) {