This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 6f65bc3d19d NIFI-15887 Added NiFi Registry test data source factory
for Postgres 17 and 18 (#11185)
6f65bc3d19d is described below
commit 6f65bc3d19d8fda3a9c2aeb3a1a1795b2e0a3aa7
Author: Matt Burgess <[email protected]>
AuthorDate: Wed May 6 18:07:15 2026 -0400
NIFI-15887 Added NiFi Registry test data source factory for Postgres 17 and
18 (#11185)
Signed-off-by: David Handermann <[email protected]>
---
.../registry/db/Postgres12DataSourceFactory.java | 53 ----------------------
.../registry/db/Postgres13DataSourceFactory.java | 53 ----------------------
.../registry/db/Postgres14DataSourceFactory.java | 53 ----------------------
...ctory.java => Postgres17DataSourceFactory.java} | 6 +--
...ctory.java => Postgres18DataSourceFactory.java} | 6 +--
nifi-registry/nifi-registry-core/pom.xml | 47 ++-----------------
6 files changed, 10 insertions(+), 208 deletions(-)
diff --git
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres12DataSourceFactory.java
b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres12DataSourceFactory.java
deleted file mode 100644
index 552d57887a6..00000000000
---
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres12DataSourceFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.db;
-
-import jakarta.annotation.PostConstruct;
-import org.postgresql.ds.PGSimpleDataSource;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.testcontainers.delegate.DatabaseDelegate;
-import org.testcontainers.jdbc.JdbcDatabaseDelegate;
-import org.testcontainers.postgresql.PostgreSQLContainer;
-
-import javax.sql.DataSource;
-
-@Configuration
-@Profile("postgres-12")
-public class Postgres12DataSourceFactory extends TestDataSourceFactory {
-
- private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new
PostgreSQLContainer("postgres:12");
-
- static {
- POSTGRESQL_CONTAINER.start();
- }
-
- @Override
- protected DataSource createDataSource() {
- PGSimpleDataSource dataSource = new PGSimpleDataSource();
- dataSource.setUrl(POSTGRESQL_CONTAINER.getJdbcUrl());
- dataSource.setUser(POSTGRESQL_CONTAINER.getUsername());
- dataSource.setPassword(POSTGRESQL_CONTAINER.getPassword());
- return dataSource;
- }
-
- @PostConstruct
- public void initDatabase() {
- DatabaseDelegate databaseDelegate = new
JdbcDatabaseDelegate(POSTGRESQL_CONTAINER, "");
- databaseDelegate.execute("DROP DATABASE test; CREATE DATABASE test;",
"", 0, false, true);
- }
-}
diff --git
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres13DataSourceFactory.java
b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres13DataSourceFactory.java
deleted file mode 100644
index 48386c12d81..00000000000
---
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres13DataSourceFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.db;
-
-import jakarta.annotation.PostConstruct;
-import org.postgresql.ds.PGSimpleDataSource;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.testcontainers.delegate.DatabaseDelegate;
-import org.testcontainers.jdbc.JdbcDatabaseDelegate;
-import org.testcontainers.postgresql.PostgreSQLContainer;
-
-import javax.sql.DataSource;
-
-@Configuration
-@Profile("postgres-13")
-public class Postgres13DataSourceFactory extends TestDataSourceFactory {
-
- private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new
PostgreSQLContainer("postgres:13");
-
- static {
- POSTGRESQL_CONTAINER.start();
- }
-
- @Override
- protected DataSource createDataSource() {
- PGSimpleDataSource dataSource = new PGSimpleDataSource();
- dataSource.setUrl(POSTGRESQL_CONTAINER.getJdbcUrl());
- dataSource.setUser(POSTGRESQL_CONTAINER.getUsername());
- dataSource.setPassword(POSTGRESQL_CONTAINER.getPassword());
- return dataSource;
- }
-
- @PostConstruct
- public void initDatabase() {
- DatabaseDelegate databaseDelegate = new
JdbcDatabaseDelegate(POSTGRESQL_CONTAINER, "");
- databaseDelegate.execute("DROP DATABASE test; CREATE DATABASE test;",
"", 0, false, true);
- }
-}
diff --git
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres14DataSourceFactory.java
b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres14DataSourceFactory.java
deleted file mode 100644
index 46fb823c653..00000000000
---
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres14DataSourceFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.db;
-
-import jakarta.annotation.PostConstruct;
-import org.postgresql.ds.PGSimpleDataSource;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.testcontainers.delegate.DatabaseDelegate;
-import org.testcontainers.jdbc.JdbcDatabaseDelegate;
-import org.testcontainers.postgresql.PostgreSQLContainer;
-
-import javax.sql.DataSource;
-
-@Configuration
-@Profile("postgres-14")
-public class Postgres14DataSourceFactory extends TestDataSourceFactory {
-
- private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new
PostgreSQLContainer("postgres:14");
-
- static {
- POSTGRESQL_CONTAINER.start();
- }
-
- @Override
- protected DataSource createDataSource() {
- PGSimpleDataSource dataSource = new PGSimpleDataSource();
- dataSource.setUrl(POSTGRESQL_CONTAINER.getJdbcUrl());
- dataSource.setUser(POSTGRESQL_CONTAINER.getUsername());
- dataSource.setPassword(POSTGRESQL_CONTAINER.getPassword());
- return dataSource;
- }
-
- @PostConstruct
- public void initDatabase() {
- DatabaseDelegate databaseDelegate = new
JdbcDatabaseDelegate(POSTGRESQL_CONTAINER, "");
- databaseDelegate.execute("DROP DATABASE test; CREATE DATABASE test;",
"", 0, false, true);
- }
-}
diff --git
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres10DataSourceFactory.java
b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres17DataSourceFactory.java
similarity index 93%
rename from
nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres10DataSourceFactory.java
rename to
nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres17DataSourceFactory.java
index ca7484b4084..b63c2596ad6 100644
---
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres10DataSourceFactory.java
+++
b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres17DataSourceFactory.java
@@ -27,10 +27,10 @@ import org.testcontainers.postgresql.PostgreSQLContainer;
import javax.sql.DataSource;
@Configuration
-@Profile("postgres-10")
-public class Postgres10DataSourceFactory extends TestDataSourceFactory {
+@Profile("postgres-17")
+public class Postgres17DataSourceFactory extends TestDataSourceFactory {
- private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new
PostgreSQLContainer("postgres:10");
+ private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new
PostgreSQLContainer("postgres:17");
static {
POSTGRESQL_CONTAINER.start();
diff --git
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres11DataSourceFactory.java
b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres18DataSourceFactory.java
similarity index 93%
rename from
nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres11DataSourceFactory.java
rename to
nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres18DataSourceFactory.java
index 18c70347125..6c6e350e910 100644
---
a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres11DataSourceFactory.java
+++
b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres18DataSourceFactory.java
@@ -27,10 +27,10 @@ import org.testcontainers.postgresql.PostgreSQLContainer;
import javax.sql.DataSource;
@Configuration
-@Profile("postgres-11")
-public class Postgres11DataSourceFactory extends TestDataSourceFactory {
+@Profile("postgres-18")
+public class Postgres18DataSourceFactory extends TestDataSourceFactory {
- private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new
PostgreSQLContainer("postgres:11");
+ private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new
PostgreSQLContainer("postgres:18");
static {
POSTGRESQL_CONTAINER.start();
diff --git a/nifi-registry/nifi-registry-core/pom.xml
b/nifi-registry/nifi-registry-core/pom.xml
index 5c6247dd7ab..44b79b8d9cc 100644
--- a/nifi-registry/nifi-registry-core/pom.xml
+++ b/nifi-registry/nifi-registry-core/pom.xml
@@ -155,7 +155,7 @@
</configuration>
</execution>
<execution>
- <id>postgres10-test</id>
+ <id>postgres17-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -163,12 +163,12 @@
</goals>
<configuration>
<systemPropertyVariables>
-
<spring.profiles.active>postgres-10</spring.profiles.active>
+
<spring.profiles.active>postgres-17</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
- <id>postgres11-test</id>
+ <id>postgres18-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -176,46 +176,7 @@
</goals>
<configuration>
<systemPropertyVariables>
-
<spring.profiles.active>postgres-11</spring.profiles.active>
- </systemPropertyVariables>
- </configuration>
- </execution>
- <execution>
- <id>postgres12-test</id>
- <phase>verify</phase>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
-
<spring.profiles.active>postgres-12</spring.profiles.active>
- </systemPropertyVariables>
- </configuration>
- </execution>
- <execution>
- <id>postgres13-test</id>
- <phase>verify</phase>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
-
<spring.profiles.active>postgres-13</spring.profiles.active>
- </systemPropertyVariables>
- </configuration>
- </execution>
- <execution>
- <id>postgres14-test</id>
- <phase>verify</phase>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
-
<spring.profiles.active>postgres-14</spring.profiles.active>
+
<spring.profiles.active>postgres-18</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>