fixed tests to run with shared context

This commit is contained in:
Timo Bejan 2021-09-16 16:48:02 +03:00
parent cdbcdcff38
commit a588963e0b

View File

@ -56,14 +56,16 @@ public abstract class AbstractPersistenceServerServiceTest {
protected PDFTronRedactionClient pdfTronRedactionClient;
@ClassRule
public static PostgreSQLContainer postgreSQLContainer = SpringPostgreSQLTestContainer.getInstance()
.withDatabaseName("integration-tests-db")
.withUsername("sa")
.withPassword("sa");
static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
var postgreSQLContainer = SpringPostgreSQLTestContainer.getInstance()
.withDatabaseName("integration-tests-db")
.withUsername("sa")
.withPassword("sa");
postgreSQLContainer.start();
TestPropertyValues.of(
"spring.datasource.url=" + postgreSQLContainer.getJdbcUrl(),
"spring.datasource.username=" + postgreSQLContainer.getUsername(),