Hello @Moses_Mutesasira , @mherman22 , @Agaba_Derrick_Junior
I’ve recently been looking into the issue: Add CountyService Integration Test, though the COUNTY
table does not exist in the database, because its SQL command is not included in the OpenELIS-Global.sql file
Is this intentional, or not?, If it’s intentional, how are datasets supposed to be created?
Thanks!
1 Like
if this is intentional rather than an oversight we could have a work round strategy to go round when creating this test
we could add
@BeforeAll
public static void setupDatabase() {
jdbcTemplate.execute("CREATE SEQUENCE IF NOT EXISTS county_seq");
jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS COUNTY (" +
"ID VARCHAR(10) PRIMARY KEY, " +
"LASTUPDATED TIMESTAMP, " +
"REGION_ID VARCHAR(10), " +
"COUNTY VARCHAR(75) NOT NULL)");
jdbcTemplate.update("INSERT INTO COUNTY (ID, COUNTY) VALUES ('1', 'Test County')");
}
I have paraphrased this according to the county.hbm.xml
data for the county service
1 Like
Wow, thanks @Agaba_Derrick_Junior, this looks to be a viable workaround, though I think we should be sure first whether it was intentional to leave the table out