Search Results for: testkit

Akka HTTP Route Testing

Reading Time: 2 minutes Akka HTTP puts a lot of focus on testability of code. It has a dedicated module akka-http-testkit for testing rest api’s. When you use this testkit you are not need to run external web server or application server to test your rest API’s. It will do all needed the stubbing and mocking for you which greatly simplifies the testing process. Adding dependency You need to add akka-http-testkit Continue Reading

Testing for Rejection handling in Akka HTTP Routes

Reading Time: 2 minutes We will learn how we able to testing for rejection handling in Akka-Http.We will be using Akka TestKit and Akka-Http TestKit.Dependencies are as follows: Suppose we have a rejection builder and a route A regular test case for this route would look like But what if we want to test when the parameters are missing? That test case will be Because we are passing no Continue Reading

Testing Rejection Handling in Akka-Http

Reading Time: 2 minutes In my previous blog, I discussed how to handle rejections in Akka Http. You may find it here. We left it on terms to explain the testing of it later. Keeping the promise 😉 In this blog, we will learn how to be able to write the test cases for rejection handling in Akka-Http. We will be using Akka TestKit and Akka-Http TestKit. Dependencies are Continue Reading

Handling HTTPS requests with Akka-HTTPS Server

Reading Time: 2 minutes Hi guys, In my last blogs I explained how one can create a self-signed certificate and KeyStore in PKCS12. You can go through the previous blog, as we’ll be needing certificate and keystore  for handling HTTPS requests. https://blog.knoldus.com/2016/10/18/create-a-self-signed-ssl-certificate-using-openssl/ https://blog.knoldus.com/2016/10/26/how-to-create-a-keystore-in-pkcs12-format/ Akka-HTTP provides both Server-Side and Client-Side HTTPS support. In this blog I’ll be covering the Server-Side HTTPS support. Let’s start with “why do we need server-side HTTPS support?” If we want the communication between the browser and Continue Reading

Lagom 1.4: What’s new?

Reading Time: 7 minutes Lagom is a reactive microservice framework, which is increasingly becoming the go-to solution for building a microservice-based architecture for industry-wide services. In case you still haven’t heard of it, this blog post will not only familiarize you with the idea behind Lagom but will also walk you through some history of Lagom since its 1.0 launch, what’s new in the latest stable release, and some Continue Reading

Test cases for file upload using akka-http in Scala

Reading Time: < 1 minute Hello folks, In my previous blog, i explained how to upload a file using akka-http in Scala. Later, i got the queries about the test cases for the same. Therefore, in this blog I am going to explain the way of writing test cases for file upload. First we need to add test dependency : “com.typesafe.akka” %% “akka-http-testkit” % “2.4.3”, “org.scalatest” %% “scalatest” % “2.2.6” % Continue Reading

Upgrade your Spark REST Server with Akka HTTP & Spark 2.0

Reading Time: 2 minutes About an year ago, in one of our blog – Spark with Spray Starter Kit we explained about creating REST Services with Spark and Spray. But, from past one year there has not been much development on Spray which tells us that soon Spray will be out-of-phase. So, we decided to Upgrade our Spark REST Server with Akka HTTP and Spark 2.0. Akka HTTP is a suite of Continue Reading

Akka Persistence using MongoDB – Part I

Reading Time: 3 minutes Akka is a powerful actor based tool kit for Concurrency, Parallelism and Clustering. But for every concurrent applications, Akka actors are not fit because Futures are another alternative for performing Concurrency. Most of the developers follow simple rules for using Future and Actors is “Futures for Concurrency, Actors for State“. In concurrent applications most of the time we are facing race conditions and deadlocks. Because Continue Reading

Cassandra with Spark 2.0 : Building Rest API !

Reading Time: 3 minutes In this tutorial , we will be demonstrating how to make a REST service in Spark using Akka-http as a side-kick  😉  and Cassandra as the data store. We have seen the power of Spark earlier and when it is combined with Cassandra in a right way it becomes even more powerful. Earlier we have seen how to build Rest Api on Spark and Couchbase Continue Reading

Testing in Lagom(Advanced Testing Scenarios)

Reading Time: 7 minutes What’s the problem?  Testcases in Lagom. So, You want to write better unit and integration test cases then You have got read this blog.  Alright, Let’s see what it takes to test your code in Lagom. In this blog I will be taking up different scenarios and try to explain How to write test cases for that particular scenario. Testing in Lagom Testing in Lagom Continue Reading

File upload using akka-http in Scala

Reading Time: 2 minutes Lets begin with some introduction of Akka-http first. Akka HTTP is a layer to expose Actors to the web via HTTP and to enable them to consume HTTP services as a client. It is not an HTTP framework, it is an Actor-based toolkit for interacting with web services and clients. This toolkit is structured into several layers: akka-http-core: A complete implementation of the HTTP standard, both Continue Reading

How to setup Cassandra Phantom driver for Scala

Reading Time: 2 minutes Phantom is a high performance Scala DSL for Apache Cassandra and now the leading tool for integrating Cassandra in the Scala Eco-system. So, if you are planning on using Cassandra with Scala, phantom is the weapon of choice. It has slowly but surely grown to become an established Scala framework and through its high focus on: Scala type system to mimic CQL and translate them Continue Reading

:)