Skip to content

Commit

Permalink
Close Taskana#2200 - fix the exception text for wrong classification …
Browse files Browse the repository at this point in the history
…categoeries
  • Loading branch information
ryzheboka committed Feb 9, 2024
1 parent 652074c commit 8817ae2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -958,10 +958,12 @@ void should_ThrowInvalidArgumentEx_When_ClassificationTypesDoesNotExist() {
assertThatThrownBy(call)
.isInstanceOf(InvalidArgumentException.class)
.hasMessageContaining(
"Parameter classificationCategoriesByType "
+ "(taskana.classification.categories.<KEY>) "
+ "contains invalid Classification Types."
+ " configured: [VALID] detected: [DOES_NOT_EXIST]");
"Parameter classificationCategoriesByType"
+ " (taskana.classification.categories.<KEY>) 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,6 @@ public Builder enforceServiceLevel(boolean enforceServiceLevel) {
this.enforceServiceLevel = enforceServiceLevel;
return this;
}

// endregion

// region authentication configuration
Expand Down Expand Up @@ -1447,12 +1446,11 @@ private void validateConfiguration() {
if (!new HashSet<>(classificationTypes)
.containsAll(classificationCategoriesByType.keySet())) {
throw new InvalidArgumentException(
String.format(
"Parameter classificationCategoriesByType (taskana.classification.categories.<KEY>)"
+ " 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)) {
Expand Down

0 comments on commit 8817ae2

Please sign in to comment.