Feedback from code reviews

This commit is contained in:
2022-10-03 09:09:06 -05:00
parent 17cace070c
commit 3f84271a36
25 changed files with 303 additions and 284 deletions

View File

@ -191,6 +191,12 @@ class FormulaInterpreterTest
assertEquals("Yes", interpretFormula(vi, "IF(GT(${input.one},0),Yes,No)"));
assertEquals("No", interpretFormula(vi, "IF(LT(${input.one},0),Yes,No)"));
assertEquals("Yes", interpretFormula(vi, "IF(true,Yes,No)"));
assertEquals("Yes", interpretFormula(vi, "IF(True,Yes,No)"));
assertEquals("No", interpretFormula(vi, "IF(false,Yes,No)"));
assertEquals("No", interpretFormula(vi, "IF(False,Yes,No)"));
assertThatThrownBy(() -> interpretFormula(vi, "IF(foo,Yes,No)")).hasRootCauseMessage("Could not evaluate string 'foo' as a boolean.");
}
}

View File

@ -423,7 +423,7 @@ public class GenerateReportActionTest
.withDataSourceName("persons")
.withType(ReportType.SUMMARY)
.withPivotFields(List.of("lastName"))
.withTotalRow(includeTotalRow)
.withIncludeTotalRow(includeTotalRow)
.withTitleFormat("Number of shoes - people born between %s and %s - pivot on LastName, sort by Quantity, Revenue DESC")
.withTitleFields(List.of("${input.startDate}", "${input.endDate}"))
.withOrderByFields(List.of(new QFilterOrderBy("shoeCount"), new QFilterOrderBy("sumPrice", false)))

View File

@ -174,7 +174,7 @@ class QMetaDataVariableInterpreterTest
assertEquals("bar", variableInterpreter.interpretForObject("${input.foo}"));
assertEquals(new BigDecimal("3.50"), variableInterpreter.interpretForObject("${input.amount}"));
assertEquals("${input.x}", variableInterpreter.interpretForObject("${input.x}"));
assertNull(variableInterpreter.interpretForObject("${input.x}"));
}
@ -189,13 +189,13 @@ class QMetaDataVariableInterpreterTest
variableInterpreter.addValueMap("input", Map.of("amount", new BigDecimal("3.50"), "x", "y"));
variableInterpreter.addValueMap("others", Map.of("foo", "fu", "amount", new BigDecimal("1.75")));
assertEquals("${input.foo}", variableInterpreter.interpretForObject("${input.foo}"));
assertNull(variableInterpreter.interpretForObject("${input.foo}"));
assertEquals("fu", variableInterpreter.interpretForObject("${others.foo}"));
assertEquals(new BigDecimal("3.50"), variableInterpreter.interpretForObject("${input.amount}"));
assertEquals(new BigDecimal("1.75"), variableInterpreter.interpretForObject("${others.amount}"));
assertEquals("y", variableInterpreter.interpretForObject("${input.x}"));
assertEquals("${others.x}", variableInterpreter.interpretForObject("${others.x}"));
assertEquals("${input.nil}", variableInterpreter.interpretForObject("${input.nil}"));
assertNull(variableInterpreter.interpretForObject("${others.x}"));
assertNull(variableInterpreter.interpretForObject("${input.nil}"));
}