Testcontainers-java: Postgres container fails in 1.12.0; app can not connect.

Created on 29 Jul 2019  路  3Comments  路  Source: testcontainers/testcontainers-java

This test works with 1.11.4, but fails with 1.12.0; here is the log of the failed test run.

Dependencies are up-to-date, i.e. Spring Boot 2.1.6 and JUnit 5.5.1 and AssertJ 3.13.0.

modulejdbc resolutioinvalid

Most helpful comment

we only document changes that affect the public API and/or the behaviour.

It is recommended to use the URL parsing libraries to avoid issues like that one, we only guarantee that the returned string will be an URL, and it is valid to have pre-set query parameters in URLs

All 3 comments

"spring.datasource.url=" + database.getJdbcUrl() + "?currentSchema=itest",

This assumes that the URL does not contain ? already. Try replacing ? with &, because, in 1.12.0, we set some query parameters already:
https://github.com/testcontainers/testcontainers-java/blob/2d11d80034c47f6d6538e036e77f50c0ede98018/modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java#L62

Thanks; that works. Please in the future document such changes.

we only document changes that affect the public API and/or the behaviour.

It is recommended to use the URL parsing libraries to avoid issues like that one, we only guarantee that the returned string will be an URL, and it is valid to have pre-set query parameters in URLs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bsideup picture bsideup  路  4Comments

rnorth picture rnorth  路  3Comments

denis-zhdanov picture denis-zhdanov  路  3Comments

chomhanks picture chomhanks  路  3Comments

andredasilvapinto picture andredasilvapinto  路  3Comments