A short tutorial describing how to plug Liquibase into Play! Framework and use it in unit tests with ScalaTest.

First Step. Add Liquibase to library dependencies in build.sbt:

"com.ticketfly" %% "play-liquibase" % "1.4"

This lib comes from a dedicated project.

Second Step. Create the m...

Continue reading...

Many words are said about ORMs. In Scala, this is a very special case.

I need just to read and write some data in a relational DB. Something messy but simple like JPA ported to Scala would do the job, but I lost all the hope to find it.

I look into the default choice for Play!, the Slick Fram...

Continue reading...

This is a follow-up to my answer to this Code Review question, which attracted a bit more thoughts of mine because there are multiple approaches to the solution within the same pattern.

Here is the list of these approaches:

  1. Classic, enhanced for loops, or using iterators. I group them togeth...

Continue reading...

A few days ago I came across a portion of code that quickly became legacy and hard to maintain. Several methods accumulated similar instructions to handle exceptions, but contained different logic and returned incompatible object types, for example:

public Item findItem(String context, String grou...

Continue reading...

The official Play! documentation provides examples of mocking external Web services responses that use quite a complex construct:

  Server.withRouter() {
    case GET(p"/repositories") => Action {
      Results.Ok(Json.arr(Json.obj("full_name" -> "octocat/Hello-World")))
    }
  } { implicit por...

Continue reading...