Skip to content

Instantly share code, notes, and snippets.

View lucmolinari's full-sized avatar

Luciano Molinari lucmolinari

View GitHub Profile
import cats.effect.{ExitCode, IO, IOApp}
import cats.implicits._
import cats.data.EitherT
object MockedProgram extends IOApp {
def run(args: List[String]): IO[ExitCode] = {
// val a1 = for {
// s <- EitherT.right(IO(1))
@lucmolinari
lucmolinari / HelloWorld.scala
Last active September 24, 2018 20:03
Testing Future Objects with ScalaTest - More details at http://lucianomolinari.com/2016/08/07/testing-future-objects-scalatest/
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
object HelloWorld {
val theOneWhoCannotBeNamed = "Voldemort"
def sayHelloTo(name: String): Future[Option[String]] = {
Future {
if (theOneWhoCannotBeNamed.equals(name)) None else Some(getHelloMessage(name))
@lucmolinari
lucmolinari / arquillian-clustered-docker.txt
Last active November 11, 2015 22:15
Using arquillian with Docker without any extensions
I have a test project which main purpose is to test our software running in clustered environments.
For this, we have a set of containers defined as mode="manual". We extensively use
ContainerController and Deployer APIs to start/stop containers and deploy/undeploy applications.
This works fine in the jboss-as-arquillian-container-managed environemt.
Now we're working on a POC to use Docker in these tests. The idea is to use
jboss-as-arquillian-container-remote adapter and, in our code, instead of using the
ContainerController to start/stop the container, we'd use docker-java API. We've been able to start
the container as expected, but the the Deployer API can not deploy the app because it thinks the
container is not running.