Springboot liquibase Oracle Junit测试案件执行失败
我有一个Springboot应用程序,其中使用Liquibase生成Oracle模式和表。 运行应用程序时,运行良好。
但是,当我尝试运行JUNIT测试案例时,它会在以下错误时失败,
Error creating bean name 'liquibase' defined in class path resource....
Migration failed for change set /db/changelog/....
Reason : liquibase.exception.DatabaseException: Schema "XYZ" not found; SQL statement
数据库中都存在架构和表。
不过,为什么我会遇到这个错误?
请提出任何建议。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在媒体上找到了一篇文章,涉及未发现您错误的部分错误。链接:
在步骤3中,文章建议Spring用户在您的资源文件夹中添加文件并将其命名为schema-h2.sql。在文件中,他们给出了此示例:
对于第4步,您可以在 *.properties文件中打开初始化模式。这将导致schema-platform.sql文件按预期执行。
到达步骤5时,请确保您的平台名称与 *.sql文件匹配。他们在文章中的屏幕截图中显示的示例如下所示。
然后,仔细检查所有模式名称非常匹配,您应该很好。
I found an article on Medium regarding the Schema Not Found part of your error. Link: Fix - Schema Not Found and Why
In step 3, the article recommends spring users add a file in your resource folder and name it schema-h2.sql. Within the file they give this example:
For step 4, you turn on your initialization-mode in your *.properties files. This will cause the schema-platform.sql files to be executed as expected.
When you reach step 5, make sure your platform name matches the *.sql file. the example they show in the screenshot in the article is shown below.
Then, double check all your schema names match perfectly, and you should be good to go.