All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dimafeng.testcontainers.DynaliteContainer.scala Maven / Gradle / Ivy

The newest version!
package com.dimafeng.testcontainers

import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.client.builder.AwsClientBuilder
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB
import org.testcontainers.dynamodb.{DynaliteContainer => JavaDynaliteContainer}
import org.testcontainers.utility.DockerImageName

case class DynaliteContainer(
  dockerImageName: DockerImageName = DockerImageName.parse(DynaliteContainer.defaultDockerImageName)
) extends SingleContainer[JavaDynaliteContainer] {

  override val container: JavaDynaliteContainer = {
    val c = new JavaDynaliteContainer(dockerImageName)
    c.withExposedPorts(4567)
    c
  }

  def client: AmazonDynamoDB = container.getClient

  def endpointConfiguration: AwsClientBuilder.EndpointConfiguration = container.getEndpointConfiguration

  def credentials: AWSCredentialsProvider = container.getCredentials
}

object DynaliteContainer {

  val defaultDockerImageName = "quay.io/testcontainers/dynalite:v1.2.1-1"

  case class Def(
    dockerImageName: DockerImageName = DockerImageName.parse(DynaliteContainer.defaultDockerImageName)
  ) extends ContainerDef {

    override type Container = DynaliteContainer

    override def createContainer(): DynaliteContainer = {
      new DynaliteContainer(
        dockerImageName
      )
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy