Skip to content

Commit 6e7ca54

Browse files
committed
feat: add the handlers to DockerControllerSpecSupport
1 parent 4e8c04b commit 6e7ca54

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docker-controller-scala-scalatest/src/main/scala/com/github/j5ik2o/dockerController/DockerControllerSpecSupport.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ trait DockerControllerSpecSupport extends SuiteMixin with DockerControllerHelper
6060

6161
protected def beforeCreateContainers(): Unit = {}
6262
protected def afterRemoveContainers(): Unit = {}
63+
protected def afterStartContainers(): Unit = {}
64+
protected def beforeStopContainers(): Unit = {}
6365

6466
abstract override def run(testName: Option[String], args: Args): Status = {
6567
(createRemoveLifecycle, startStopLifecycle) match {
@@ -76,7 +78,10 @@ trait DockerControllerSpecSupport extends SuiteMixin with DockerControllerHelper
7678
beforeCreateContainers()
7779
created = createDockerContainers(DockerContainerCreateRemoveLifecycle.ForAllTest, testName)
7880
started = startDockerContainers(DockerContainerStartStopLifecycle.ForAllTest, testName)
79-
super.run(testName, args)
81+
afterStartContainers()
82+
val result = super.run(testName, args)
83+
beforeStopContainers()
84+
result
8085
} finally {
8186
try {
8287
if (started)

0 commit comments

Comments
 (0)