dan-s1 commented on code in PR #11761:
URL: https://github.com/apache/nifi/pull/11761#discussion_r4402588354


##########
nifi-extension-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/record/sink/db/DatabaseRecordSinkTest.java:
##########
@@ -90,89 +92,102 @@ public class DatabaseRecordSinkTest {
     private static final String SERVICE_ID = 
DBCPConnectionPool.class.getName();
 
     private static final String DRIVER_CLASS = "org.hsqldb.jdbc.JDBCDriver";
-    private static final String CONNECTION_URL_FORMAT = "jdbc:hsqldb:file:%s";
+    private static final String CONNECTION_URL_FORMAT = 
"jdbc:hsqldb:file:%s/nifi";
 
     private String connectionUrl;
     private DBCPConnectionPool dbcpService;
+    private TestRunner runner;
 
     @BeforeEach
     public void setService(@TempDir final Path tempDir) throws 
InitializationException {
         dbcpService = new DBCPConnectionPool();
-        TestRunner runner = TestRunners.newTestRunner(NoOpProcessor.class);
+        runner = TestRunners.newTestRunner(NoOpProcessor.class);
         runner.addControllerService(SERVICE_ID, dbcpService);
 
-        connectionUrl = CONNECTION_URL_FORMAT.formatted(tempDir);
+        connectionUrl = 
CONNECTION_URL_FORMAT.formatted(tempDir.toAbsolutePath());
         runner.setProperty(dbcpService, DATABASE_URL, connectionUrl);
         runner.setProperty(dbcpService, DB_USER, String.class.getSimpleName());
         runner.setProperty(dbcpService, DB_PASSWORD, String.class.getName());
         runner.setProperty(dbcpService, DB_DRIVERNAME, DRIVER_CLASS);
     }
 
+    @AfterEach
+    public void shutdownDatabase() throws SQLException {
+        runner.shutdown();
+        dbcpService.shutdown();
+
+        try (Connection conn = DriverManager.getConnection(connectionUrl);

Review Comment:
   @exceptionfactory I followed the same pattern as `DBCPServiceTest` where 
there are fixed `private static final` fields `USERNAME` and `PASSWORD` where I 
use them in the `setService` method when configuring the service and I use 
those same variables in the `shutdownDatabase` method. So I do not understand 
how they are mismatched or missing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to