Index: src/test/scala/ing/wbaa/druid/auth/basic/BasicAuthenticationSpec.scala IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- src/test/scala/ing/wbaa/druid/auth/basic/BasicAuthenticationSpec.scala (revision Local Version) +++ src/test/scala/ing/wbaa/druid/auth/basic/BasicAuthenticationSpec.scala (revision Shelved Version) @@ -21,6 +21,7 @@ import scala.language.postfixOps import akka.http.scaladsl.model.StatusCodes +import akka.stream.scaladsl.Sink import ing.wbaa.druid.{ DruidConfig, QueryHost, TimeSeriesQuery } import ing.wbaa.druid.client.{ DruidAdvancedHttpClient, HttpStatusException } import ing.wbaa.druid.definitions._ @@ -75,6 +76,8 @@ hosts = Seq(QueryHost("localhost", 8088)) ) + val mat = config.client.actorMaterializer + "successfully query Druid when an Authentication config is set" in { val request = TimeSeriesQuery( aggregations = List( @@ -88,6 +91,21 @@ response.list[TimeseriesCount].map(_.count).sum shouldBe totalNumberOfEntries } } + + "successfully be streamed" in { + val request = TimeSeriesQuery( + aggregations = List( + CountAggregation(name = "count") + ), + granularity = GranularityType.Hour, + intervals = List("2011-06-01/2017-06-01") + ).streamAs[TimeseriesCount].runWith(Sink.seq)(mat) + + whenReady(request) { response => + response.map(_.count).sum shouldBe totalNumberOfEntries + } + + } } }