ScalaTest

Solr With Scala: Rest End Points with AKKA HTTP

Hello Folks, Today we will discuss about Solr, Scala with Akka-HTTP. We will create rest-endpoints and try to connect with Solr server with them. The basic idea behind using Akka-HTTP for creating Rest end points is modules implement a full server and client-side HTTP stack on top of akka-actor and akka-stream. We can customize these routes according to our use case. We will talk step Continue Reading

Generating, visiting and unit testing grammar using ANTLR4 with Java and Scala

“Quality is free, but only to those who are willing to pay heavily for it” – T. DeMarco Now unit testing is not that heavy to pay off so lets start the blog. In this blog we will be continuing the voyage to the kingdom of ANTLR4 RECAP In previous blog we discussed how to test whether a string is grammatically correct or not using Continue Reading

KnolX: Unit Testing of Spark Applications

Knoldus organized a KnolX session on Wednesday, 13 April 2016. In this KnolX session, we explored the different methods of writing unit tests for Spark applications. This session also talks about how unit testing of Spark applications is done, as well as tells about the best way to do it. This includes writing unit tests with and without Spark Testing Base package, which is a spark Continue Reading

How to write test-case for Scala.js application

Few months ago, I created a web application ‘Weather Report‘, based on Scala.js.  In this blog, I have explained how we can test our Scala.js application. Since I am still exploring it, so I took help from scalajs-tutorial.  I have used µTest as testing library. // uTest settings libraryDependencies += “com.lihaoyi” %%% “utest” % “0.3.0” % “test” testFrameworks += new TestFramework(“utest.runner.Framework”) Here is example of test-cases: def tests = Continue Reading

Testing Scala Applications with In-memory mongoDB

Is your test suite taking a large amount of time to run just because your methods need some database queries to be handled? Testing with In-memory databases can save a hell lot of time. In-memory database makes the queries readily available to methods in a matter of milliseconds. In case you are using mongoDB, this blog can help you run your test suite much faster Continue Reading

Swagger With Play2

What is Swagger : Swagger is very powerful tool for REST API description and API documentation.Swagger API gives a Swagger GUI for humans to learn and test your API.It’s 100% open source.The goal of Swagger is to enable client and documentation systems to update at the same pace as the server. The documentation of methods, parameters, and models are tightly integrated into the server code, Continue Reading

Mock Unit Testing using Mockito in Play Scala project

During Unit Testing in a Play Scala project, there arises a need to Mock certain Objects or Traits which are used in the unit, so that the unit being tested has a consistent interaction with its outside dependencies. But due to tight coupling or external dependencies, objects cannot be tested as a unit. So, we need to mock those external dependencies by adding fake external Continue Reading

Employee-Self-Service – Building Reactive Play application with Anorm SQL data access – (Part-2)

Last week, We have created a simple Employee-Self-Service  application using Play Framework and Anorm SQL data access , which has CRUD facility. Now we have added more features, i.e. Handling asynchronous results with time-outs facility thus application is now reactive (Async + Non-Blocking) Play and Scala-based template engine implementation. Bootswatch-Yeti with Twitter Bootstrap 3.1.1 to improve the look and feel of the application Application screens: 1. Continue Reading

ATDD, Generating random tests with ScalaCheck

Further, in our series on Acceptance Test Driven Development, we would look at generating random test values with the ScalaCheck framework. In our last post we looked at, how we make our test logic respect the DRY principle by defining the values in a table. However, in many situations, you would like to generate the values dynamically so that we do not have to fill Continue Reading

ATDD, ScalaTest, Cucumber and respecting DRY

In our last post we looked at how it was easy to use ScalaTest for doing acceptance testing. In a post prior to that, we had looked at doing the same with Cucumber. We had also concluded that though acceptance tests could be written in the way described however, there was an issue. Writing the feature files with individual features having multiple scenarios which would Continue Reading

ATDD, ScalaTest and Scala

In my last post on ATDD, we had seen how it was easy with Cucumber to write a feature file and share it with our stakeholders in order to validate our understanding of the functionality. The idea again is to build the right software right. In this post, we would learn how to do ATDD with ScalaTest but before that let us do a recap Continue Reading

Knolx Session: Introducing Scala

We organize KnolX sessions regularly at Knoldus so that our learning spreads in our organisation. This KnolX session had Scala flavor written all over it. We believe in experiential learning. This session has code examples which Knolders tried while I was explaining it. I combined sbt, Scala, Scala collections and ScalaTest together in this presentation. The objective was that by the end of Knolx session Continue Reading

%d bloggers like this: