BAEL-7263: Highlight scenarios where defined variable is evaluated as false
This commit is contained in:
parent
003e89f1c6
commit
846d763515
|
@ -10,5 +10,10 @@
|
|||
<div th:if="${serverTime != null}" th:text="'Server Time Using #th:if Conditional Is: ' + ${serverTime}"/>
|
||||
<div th:unless="${serverTime == null}" th:text="'Server Time Using #th:unless Conditional Is: ' + ${serverTime}"/>
|
||||
|
||||
<div th:if='${"false"}' th:text='"Evaluating \"false\"'/>
|
||||
<div th:if='${"no"}' th:text='"Evaluating \"no\"'/>
|
||||
<div th:if='${"off"}' th:text='"Evaluating \"off\"'/>
|
||||
<div th:if="${0}" th:text='"Evaluating 0"'/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -74,6 +74,17 @@ public class HomeControllerIntegrationTest {
|
|||
.andExpect(content().string(not(containsString(IF_CONDITIONAL_MSG))));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenVariableIsDefinedAndNotTrue_thenIfConditionalIsFalse() throws Exception {
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/variable-defined"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(view().name("checkVariableIsDefined.html"))
|
||||
.andExpect(content().string(not(containsString("Evaluating \"false\""))))
|
||||
.andExpect(content().string(not(containsString("Evaluating \"no\""))))
|
||||
.andExpect(content().string(not(containsString("Evaluating \"off\""))))
|
||||
.andExpect(content().string(not(containsString("Evaluating 0"))));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenVariableIsDefined_thenUnlessConditionalIsTrue() throws Exception {
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/variable-defined"))
|
||||
|
|
Loading…
Reference in New Issue