JUnit Testing Framework

Overview

Qualified supports writing test fixtures for Scala using JUnit 4.

Scala with JUnit Quick Start

object Sample {
  def sayHello(name: String) = {
    if(name.length() > 0)
      "Hello, " + name + "!"
    else
      "Hello there!"
  }
}
import org.junit.Test
import org.junit.Assert._

class SampleSuite {
  @Test
    def should_say_hello = {
       assertEquals(
         "Hello, Qualified!",
         Sample.sayHello("Qualified"),
       )
    }
  @Test
    def should_handle_empty_string = {
       assertEquals(
         "Hello there!",
         Sample.sayHello(""),
       )
    }
}

Learn More

You can learn more on the junit website.