mengw15 commented on code in PR #7255:
URL: https://github.com/apache/texera/pull/7255#discussion_r3699442107


##########
common/dao/src/test/scala/org/apache/texera/dao/SiteSettingsSpec.scala:
##########
@@ -18,10 +18,34 @@
 
 package org.apache.texera.dao
 
+import org.apache.texera.dao.jooq.generated.Tables.SITE_SETTINGS
+import org.scalatest.BeforeAndAfterAll
+import org.scalatest.BeforeAndAfterEach
 import org.scalatest.flatspec.AnyFlatSpec
 import org.scalatest.matchers.should.Matchers
 
-class SiteSettingsSpec extends AnyFlatSpec with Matchers {
+class SiteSettingsSpec
+    extends AnyFlatSpec
+    with Matchers
+    with BeforeAndAfterAll
+    with BeforeAndAfterEach
+    with MockTexeraDB {
+
+  // Point SqlServer (used by SiteSettings.getInt/getLong internally) and the 
test's
+  // own getDSLContext at the same embedded Postgres.
+  override protected def beforeAll(): Unit = initializeDBAndReplaceDSLContext()
+
+  override protected def afterAll(): Unit = closeConnectionPool()

Review Comment:
   Done — added `super.beforeAll()` / `super.beforeEach()` and wrapped the 
teardown as `try closeConnectionPool() finally super.afterAll()`, matching the 
`DatasetAccessResourceSpec` pattern you cited.



-- 
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