In this Article, we are going to lean how to create scala project with sbt in IntellijIDEA.

And also we will learn how to test this scala project with scalatest jar.

Technologies used are

  1. IntellijIDEA 2018.3.2(Community Edition)
  2. Scala 2.11.7
  3. Sbt 1.3.3
  4. Scalatest 3.0.0

Let start now…

Create a scala project with IntellijIDEA.

Select File -> New -> New Project

Now select Scala on the Left window and   sbt on the right windows and then click on the Next button.

Give project name in the Name field and then click on the Finish button.

The above Project Structure will be created.

  • Create package name.
  • Check the build.sbt that it has correct version .

In this project we used the following version.

  • Create a Topping case class
  • Create a Pizza Class.

 We have created required classes to test this application.

  • Add scalatest jar file to build.sbt file.
  • Create a  test class in src/test/scala  as PizzaTest
  • Run this Test .

Leave a Reply

Your email address will not be published. Required fields are marked *