I’ve been experimenting with moving from docker Postgres test containers towards H2 in-memory tests. But I’m running into a syntax exception.
I think I’ve boiled it down to some generated SQL when importing the lookup lists first thing when setting up our schema.
class ExampleTest {
@Test
void testH2LookupListImport() {
EventServiceLocal eventService = EventServiceLocal.newBuilder().build();
DataServiceSql dataServiceSql = DataServiceSql.newBuilder(eventService).build();
dataServiceSql.upsertResources(new ExampleResources(), Context.makeSystemContext());
ILookupListService lookupListService = dataServiceSql.getLookupListService();
Set<LookupList> lookupLists = lookupListService.loadAll(Context.makeSystemContext());
assertThat(lookupLists, Matchers.not(Matchers.empty()));
}
@NoArgsConstructor
public static class ExampleResources implements IResourceDescriptor {
@Override
public Optional<String> getLookupListLocation() {
return Optional.of("/exampleTest/lookuplists");
}
}
}
And here is the example lookup list I could still get to error out.
<Lookup>
<LookupList name="MyLookupList">
<item value= "A" />
<item value= "B" />
<item value= "C" />
</LookupList>
</Lookup>
I was able to get H2 to save to a file, and so was able to connect to it with my client locally. From what I can tell, the ‘LookupListItem’ table does not exist.
It appears to be from the attempt to load by ID used here: SqlDaoHelper::doLoadBatchByIdentifiersIfExists
LEAF version 3.12