Skip to content

Commit 793b810

Browse files
Add condition entity for aou_synthetic underlay. Tests for entity queries. (#84)
* Add optional TableFilter to EntityMapping. Example in nautical underlay. * Fix UnderlayConversionTest. * New test for embedded SELECT in FROM clause. * Check table filters in underlay conversion test. * Resolve table with table filter defined to a nested select. * Handle ints in column filter. * Fix UnderlaysApiControllerTest. * Make column filter value use oneof. * Make table filter use oneof. * Remove boolean from column value options because unsupported datatype. * Check that binary table filter column is in same table as pk. * Add tests for different value types and operators. * Fix checkstyle errors. * Replace System.out.println with logger. * Add condition entity. Tests for queries against AoU synthetic underlay. * Fix pmd error. * Add procedure entity. * Add measurement entity. * Add visit entity. * Add observation entity. * Add device entity. * Add ingredient entity. * Add brand entity. * Add Test suffix to test classes. * Use golden files for SQL string comparison tests. * Include gradle command to regenerate files in error msg.
1 parent a6901a8 commit 793b810

25 files changed

+1217
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ build/
44
!**/src/main/**
55
!**/src/test/**
66

7+
### Jenv ###
8+
.java-version
9+
710
### STS ###
811
.apt_generated
912
.classpath

.java-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ to regenerate the `gradle.lockfile` with the added dependencies. If this is not
2626
error about
2727
> Could not resolve all files for configuration...
2828
> Resolved foo.bar:lib:version which is not part of the dependency lock state
29+
30+
## Generating SQL strings for tests
31+
Some tests compare the SQL string generated by the API code with an expected string, stored in a golden file.
32+
An example test is `bio.terra.tanagra.aousynthethic.BrandEntityQueriesTest.generateSqlForAllBrandEntities` and
33+
the accompanying golden file is `api/src/test/resources/aousynthetic.all-brand-entities.sql`.
34+
35+
To regenerate the golden files, run the tests with the `generateSqlFiles` Gradle project property set. e.g.:
36+
`./gradlew cleanTest api:test --tests bio.terra.tanagra.aousynthetic.* --info -PgenerateSqlFiles=true`

api/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ dependencies {
8989

9090
test {
9191
useJUnitPlatform()
92+
93+
// These System properties are used for the generated SQL strings to compare against during tests.
94+
// See bio.terra.tanagra.aousynthetic.GeneratedSqlUtils for how they are used.
95+
systemProperty("GRADLE_PROJECT_DIR", projectDir)
96+
if (project.findProperty("generateSqlFiles")) {
97+
systemProperty("GENERATE_SQL_FILES", "true")
98+
}
9299
}
93100

94101
// Apply Gradle Script Plugins for more modular gradle files.

0 commit comments

Comments
 (0)