Skip to content

Commit

Permalink
test: show that a config without features can also be read
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKellerer committed Apr 27, 2023
1 parent 36050e9 commit cbae1a6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,31 @@ class DatabaseConfigTest {
)
}
}

@SpringBootTest(
properties =
[
"lapis.databaseConfig.path=src/test/resources/config/testDatabaseConfigWithoutFeatures.yaml",
],
)
class DatabaseConfigWithoutFeaturesTest {
@Autowired
private lateinit var underTest: DatabaseConfig

@Test
fun `a config without features can be read`() {
assertThat(underTest.schema.instanceName, `is`("sars_cov-2_minimal_test_config"))
assertThat(underTest.schema.primaryKey, `is`("gisaid_epi_isl"))
assertThat(
underTest.schema.metadata,
containsInAnyOrder(
DatabaseMetadata(name = "gisaid_epi_isl", type = "string"),
DatabaseMetadata(name = "date", type = "date"),
DatabaseMetadata(name = "region", type = "string"),
DatabaseMetadata(name = "country", type = "string"),
DatabaseMetadata(name = "pangoLineage", type = "pango_lineage"),
),
)
assertThat(underTest.schema.features, `is`(emptyList()))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
schema:
instanceName: sars_cov-2_minimal_test_config
metadata:
- name: gisaid_epi_isl
type: string
- name: date
type: date
- name: region
type: string
- name: country
type: string
- name: pangoLineage
type: pango_lineage
primaryKey: gisaid_epi_isl

0 comments on commit cbae1a6

Please sign in to comment.