mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#2525 add available transformations to CaseEnumTransformationStrategy exception
This commit is contained in:
parent
8c554b9556
commit
e6e9b6ce92
@ -20,6 +20,7 @@ public class CaseEnumTransformationStrategy implements EnumTransformationStrateg
|
||||
private static final String UPPER = "upper";
|
||||
private static final String LOWER = "lower";
|
||||
private static final String CAPITAL = "capital";
|
||||
private static final String CASE_ENUM_TRANSFORMATION_STRATEGIES = UPPER + ", " + LOWER + ", " + CAPITAL;
|
||||
|
||||
@Override
|
||||
public String getStrategyName() {
|
||||
@ -37,7 +38,8 @@ public class CaseEnumTransformationStrategy implements EnumTransformationStrateg
|
||||
return capitalize( value );
|
||||
default:
|
||||
throw new IllegalArgumentException(
|
||||
"Unexpected configuration for enum case transformation: " + configuration );
|
||||
"Unexpected configuration for enum case transformation: " + configuration +
|
||||
". Allowed values: " + CASE_ENUM_TRANSFORMATION_STRATEGIES);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,8 @@ public class EnumNameTransformationStrategyTest {
|
||||
kind = javax.tools.Diagnostic.Kind.ERROR,
|
||||
line = 18,
|
||||
message = "Illegal transformation for 'case' EnumTransformationStrategy." +
|
||||
" Error: 'Unexpected configuration for enum case transformation: unknown'."
|
||||
" Error: 'Unexpected configuration for enum case transformation: unknown." +
|
||||
" Allowed values: upper, lower, capital'."
|
||||
)
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user