从随机端口开始的OracleTestcontainer

时间:2018-10-19 18:48:03

标签: testcontainers

当前,OracleContainer返回带有随机端口的JDBC_URL。因此,我无法从应用程序连接到数据库。当前,我的应用程序JDBC_URL在属性文件中配置,并且无论如何我都可以在测试中覆盖它。我尝试了裸露的端口,但是没有给我固定的端口

OracleContainer mysql = (OracleContainer)新的OracleContainer(“ / wnameless / oracle-xe-11g:18.04”)。withExposedPorts(49161); mysql.addExposedPort(49161);

0 个答案:

没有答案