Closed alex123asd123asd closed 2 weeks ago
Hi, thanks for the comment. I've just tested it and it seems that this combination works fine. Technically, it should be possible to use the embedded database library with any tool that accesses the database using Spring's dataSource bean.
However, proper configuration is essential for proper operation. Make sure you have the caseSensitiveTableNames
flag enabled and that your schema name is set up correctly. In my case, the annotations below were enough to get it working.
@DBRider
@DBUnit(caseSensitiveTableNames = true, escapePattern = "\"?\"", schema = "test")
Cool it works. Thank you for your help :)
@Sql("/datasets/init.sql")
@ExtendWith(DBUnitExtension.class)
@SpringJUnitConfig(DbTestConfig.class)
@DBUnit(caseSensitiveTableNames = true)
@AutoConfigureEmbeddedDatabase(provider = ZONKY)
class CddAlertRepositoryImplV2IntegrationTest {
@Autowired
MyRepository myRepository;
Info INFO = Info.builder()
.x("x")
.y("y")
.z("z")
.build();
@Test
@DataSet("/datasets/data.xml")
void test() {
var data = myRepository.getData(INFO);
var expected = ...;
assertEquals(expected, data);
}
}
Glad to hear it 👍
Hello. Does it possible to use db rider with zonkyio embedded postgresql? I have tried, but without success -
@DataSet
annotation throws an exception that table does not exist.