This GitHub example explains how to test Akka-Http Rejections. There are two ways for the same: Matching expected rejections Using Route.seal() Both have been used in this example.