Skip to content

Commit

Permalink
Merge pull request #269 from greshny-forks/fix-deprecated-annotations
Browse files Browse the repository at this point in the history
fix deprecated annotations, bump sbt version
  • Loading branch information
dimafeng authored Jan 25, 2024
2 parents 39158b9 + d2a1e96 commit 1176c30
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
22 changes: 11 additions & 11 deletions core/src/main/scala/com/dimafeng/testcontainers/Container.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ import org.testcontainers.utility.{MountableFile, ThrowingFunction}
import scala.collection.JavaConverters._
import scala.concurrent.{Future, blocking}

@deprecated("For internal usage only. Will be deleted.")
@deprecated("For internal usage only. Will be deleted.", "v0.34.0")
trait TestContainerProxy[T <: FailureDetectingExternalResource] extends Container {

@deprecated("Please use reflective methods from the wrapper and `configure` method for creation")
@deprecated("Please use reflective methods from the wrapper and `configure` method for creation", "v0.17.0")
implicit def container: T

@deprecated("Use `stop` instead")
@deprecated("Use `stop` instead", "v0.27.0")
override def finished()(implicit description: Description): Unit = TestContainerAccessor.finished(description)

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.27.0")
override def succeeded()(implicit description: Description): Unit = TestContainerAccessor.succeeded(description)

@deprecated("Use `start` instead")
@deprecated("Use `start` instead", "v0.27.0")
override def starting()(implicit description: Description): Unit = TestContainerAccessor.starting(description)

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.27.0")
override def failed(e: Throwable)(implicit description: Description): Unit = TestContainerAccessor.failed(e, description)
}

Expand Down Expand Up @@ -79,7 +79,7 @@ abstract class SingleContainer[T <: JavaGenericContainer[_]] extends TestContain
}
}

@deprecated("See org.testcontainers.containers.Network")
@deprecated("See org.testcontainers.containers.Network", "v0.17.0")
def linkedContainers: Map[String, LinkableContainer] = container.getLinkedContainers.asScala.toMap

def mappedPort(port: Int): Int = container.getMappedPort(port)
Expand Down Expand Up @@ -163,15 +163,15 @@ abstract class SingleContainer[T <: JavaGenericContainer[_]] extends TestContain

trait Container extends Startable with Stoppable {

@deprecated("Use `stop` instead")
@deprecated("Use `stop` instead", "v0.29.0")
def finished()(implicit description: Description): Unit = stop()

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.29.0")
def failed(e: Throwable)(implicit description: Description): Unit = {}

@deprecated("Use `start` instead")
@deprecated("Use `start` instead", "v0.29.0")
def starting()(implicit description: Description): Unit = start()

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.29.0")
def succeeded()(implicit description: Description): Unit = {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ object DockerComposeContainer {

def randomIdentifier: String = Base58.randomString(DockerComposeContainer.ID_LENGTH).toLowerCase()

@deprecated("Please use expanded `apply` method")
@deprecated("Please use expanded `apply` method", "v0.19.0")
def apply(composeFiles: ComposeFile,
exposedService: Map[String, Int],
identifier: String): DockerComposeContainer =
apply(composeFiles, exposedService, identifier)


@deprecated("Please use expanded `apply` method")
@deprecated("Please use expanded `apply` method", "v0.19.0")
def apply(composeFiles: ComposeFile,
exposedService: Map[String, Int]): DockerComposeContainer =
new DockerComposeContainer(composeFiles, exposedService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import scala.language.implicitConversions

class MultipleContainers private(containers: Seq[LazyContainer[_]]) extends Container with TestLifecycleAware {

@deprecated("Use `stop` instead")
@deprecated("Use `stop` instead", "v0.27.0")
override def finished()(implicit description: Description): Unit = containers.foreach(_.finished()(description))

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.27.0")
override def succeeded()(implicit description: Description): Unit = containers.foreach(_.succeeded()(description))

@deprecated("Use `start` instead")
@deprecated("Use `start` instead", "v0.27.0")
override def starting()(implicit description: Description): Unit = containers.foreach(_.starting()(description))

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.27.0")
override def failed(e: Throwable)(implicit description: Description): Unit = containers.foreach(_.failed(e)(description))

override def beforeTest(description: TestDescription): Unit = {
Expand Down Expand Up @@ -68,16 +68,16 @@ object MultipleContainers {
class LazyContainer[T <: Container](factory: => T) extends Container with TestLifecycleAware {
lazy val container: T = factory

@deprecated("Use `stop` instead")
@deprecated("Use `stop` instead", "v0.27.0")
override def finished()(implicit description: Description): Unit = container.finished()

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.27.0")
override def failed(e: Throwable)(implicit description: Description): Unit = container.failed(e)

@deprecated("Use `start` instead")
@deprecated("Use `start` instead", "v0.27.0")
override def starting()(implicit description: Description): Unit = container.starting()

@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead")
@deprecated("Use `stop` and/or `TestLifecycleAware.afterTest` instead", "v0.27.0")
override def succeeded()(implicit description: Description): Unit = container.succeeded()

override def beforeTest(description: TestDescription): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.dimafeng.testcontainers.implicits
import org.testcontainers.utility.DockerImageName

trait DockerImageNameConverters {
@deprecated("Use `DockerImageName` in Container constructor instead")
@deprecated("Use `DockerImageName` in Container constructor instead", "v0.38.7")
implicit def stringToDockerImageName(s: String): DockerImageName =
DockerImageName.parse(s)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.testcontainers.containers

import org.junit.runner.Description

@deprecated("Should be replaced by lifecycle methods")
@deprecated("Should be replaced by lifecycle methods", "v0.27.0")
object TestContainerAccessor {
def finished[T <:FailureDetectingExternalResource](description: Description)(implicit container: T): Unit =
container.finished(description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.testcontainers.vault.{VaultContainer => JavaVaultContainer}

class VaultContainer(dockerImageNameOverride: Option[DockerImageName] = None,
vaultToken: Option[String] = None,
@deprecated vaultPort: Option[Int] = None,
@deprecated("use container's defaults", "v0.39.0") vaultPort: Option[Int] = None,
secrets: Option[VaultContainer.Secrets] = None) extends SingleContainer[JavaVaultContainer[_]] {

val vaultContainer: JavaVaultContainer[_] = {
Expand Down Expand Up @@ -37,7 +37,7 @@ object VaultContainer {

def apply(dockerImageNameOverride: DockerImageName = null,
vaultToken: String = null,
@deprecated vaultPort: Option[Int] = None,
@deprecated("use container's defaults", "v0.39.0") vaultPort: Option[Int] = None,
secrets: Option[VaultContainer.Secrets] = None): VaultContainer = new VaultContainer(
Option(dockerImageNameOverride),
Option(vaultToken),
Expand All @@ -48,7 +48,7 @@ object VaultContainer {
case class Def(
dockerImageName: DockerImageName = DockerImageName.parse(defaultDockerImageName),
vaultToken: Option[String] = None,
@deprecated vaultPort: Option[Int] = None,
@deprecated("use container's defaults", "v0.39.0") vaultPort: Option[Int] = None,
secrets: Option[VaultContainer.Secrets] = None
) extends ContainerDef {

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.0
sbt.version=1.9.8

0 comments on commit 1176c30

Please sign in to comment.