Trim expressions supplied to @DisabledIf
Prior to this commit, the DisabledIfCondition did not trim whitespace from expressions configured via @DisabledIf. Consequently, results such as " true " would evaluate to "false". This commit fixes this problem by trimming all expressions configured via @DisabledIf. Issue: SPR-14614
This commit is contained in:
@@ -50,6 +50,12 @@ class DisabledIfTestCase {
|
||||
fail("This test must be disabled");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledIf(" true ")
|
||||
void disabledByStringTrueWithSurroundingWhitespace() {
|
||||
fail("This test must be disabled");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledIf("TrUe")
|
||||
void disabledByStringTrueIgnoreCase() {
|
||||
@@ -62,12 +68,24 @@ class DisabledIfTestCase {
|
||||
fail("This test must be disabled");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledIf("\t${foo} ")
|
||||
void disabledByPropertyPlaceholderWithSurroundingWhitespace() {
|
||||
fail("This test must be disabled");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledIf("#{T(java.lang.Boolean).TRUE}")
|
||||
void disabledBySpelBoolean() {
|
||||
fail("This test must be disabled");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledIf(" #{T(java.lang.Boolean).TRUE} ")
|
||||
void disabledBySpelBooleanWithSurroundingWhitespace() {
|
||||
fail("This test must be disabled");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisabledIf("#{'tr' + 'ue'}")
|
||||
void disabledBySpelStringConcatenation() {
|
||||
|
||||
Reference in New Issue
Block a user