Spray Testkit provides a nice DSL for testing web services and APIs built on top of Spray Routing. But Spray Testkit cannot be used alone and requires ScalaTest or Specs2 libraries.
- [Narrator] In the previous video, we have gotten a brief…introduction to spray-testkit module…and the general approaches of developing test cases…for spray-routing web services and APIs.…In this video, we're going to keep our hands dirty…and develop a complete test suite for our book catalog…web APIs.…As we already know, spray-testkit provides excellent…integration with the two most popular…Scala testing frameworks, ScalaTest and Specs2.…
We are not going to pitch one or another but instead…try out both frameworks and choose whatever style we like.…Though both are just great.…With that, let's move on to the subject and dissect…different test cases written using ScalaTest…and spray-testkit.…Our first test case is very simple.…Let's ensure that no publisher is going to be returned…for empty book catalog.…
The Get indicates what kind of request and against which URI…we would like to issue.…The routes part indicates the list of routes to pass…the request through and comes directly from…BookRestApiRoutes.…And lastly, we express our expectations in the form of…
Embark on an exciting journey into the universe of web development using the Scala programming language and frameworks—natural choices for back-end developers building highly scalable, reliable, and reactive RESTful web services and APIs. This training is the starting point for mastering the nonblocking and asynchronous programming models that lie in the heart of the Spray framework. It starts with an introduction to the REST architecture. Then switch gears to the Akka toolkit and framework, building a sample book catalog application along the way.
Once you've learned about the REST architectural style and Actor model—the foundations that the Spray framework is built upon—you'll shape out your own RESTful web services by providing simple route definitions. Further on in the course, author Andriy Redko delves into authentication and authorization, secure transport, documentation, testing, and caching support. Finally, you will learn how to develop the Spray client API to call external web services.
- The Actor model and Akka framework
- RESTful architecture principles and constraints
- Building RESTful services
- Core Spray framework modules such as spray-can, spray-routing, spray-json, spray-caching, and spray-client
- Securing RESTful web services and APIs with Spray
- Configuring Spray applications with HTTPS support
- Documenting Spray RESTful web services using Swagger
- Caching basics
- Calling external RESTful services