From 2012726f1beace069f311e8fb9722c6e6c66e3fd Mon Sep 17 00:00:00 2001 From: 2beaucoup Date: Fri, 17 Jul 2015 16:22:12 +0200 Subject: [PATCH] =doc, htp minor fixes in docs and tests --- akka-docs-dev/rst/java/http/http-model.rst | 6 +++--- akka-docs-dev/rst/scala/http/common/http-model.rst | 6 +++--- .../test/scala/akka/http/impl/engine/ws/MessageSpec.scala | 2 +- .../akka/http/impl/engine/ws/WebsocketServerSpec.scala | 3 +-- .../server/directives/WebsocketDirectivesSpec.scala | 1 - 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/akka-docs-dev/rst/java/http/http-model.rst b/akka-docs-dev/rst/java/http/http-model.rst index 983831d24f..e700564f15 100644 --- a/akka-docs-dev/rst/java/http/http-model.rst +++ b/akka-docs-dev/rst/java/http/http-model.rst @@ -136,9 +136,9 @@ The class ``HttpEntities`` contains static methods to create entities from commo You can use the ``isX` methods of ``HttpEntity`` to find out of which subclass an entity is if you want to provide special handling for each of the subtypes. However, in many cases a recipient of an ``HttpEntity`` doesn't care about -of which subtype an entity is (and how data is transported exactly on the HTTP layer). Therefore, a general -``HttpEntity::getDataBytes: Source`` is provided which allows access to the data of an entity regardless -of its concrete subtype. +of which subtype an entity is (and how data is transported exactly on the HTTP layer). Therefore, the general method +``HttpEntity.getDataBytes()`` is provided which returns a ``Source`` that allows access to the data of an +entity regardless of its concrete subtype. .. note:: diff --git a/akka-docs-dev/rst/scala/http/common/http-model.rst b/akka-docs-dev/rst/scala/http/common/http-model.rst index 578f57f39c..4679c7ffac 100644 --- a/akka-docs-dev/rst/scala/http/common/http-model.rst +++ b/akka-docs-dev/rst/scala/http/common/http-model.rst @@ -133,9 +133,9 @@ The ``HttpEntity`` companion object contains several helper constructors to crea You can pattern match over the subtypes of ``HttpEntity`` if you want to provide special handling for each of the subtypes. However, in many cases a recipient of an ``HttpEntity`` doesn't care about of which subtype an entity is -(and how data is transported exactly on the HTTP layer). Therefore, a general -``HttpEntity::dataBytes: Source[ByteString, Any]`` is provided which allows access to the data of an entity regardless -of its concrete subtype. +(and how data is transported exactly on the HTTP layer). Therefore, the general method ``HttpEntity.dataBytes`` is +provided which returns a ``Source[ByteString, Any]`` that allows access to the data of an entity regardless of its +concrete subtype. .. note:: diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/MessageSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/MessageSpec.scala index c23069af72..2154cb62e9 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/MessageSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/MessageSpec.scala @@ -302,7 +302,7 @@ class MessageSpec extends FreeSpec with Matchers with WithMaterializerSpec { } "for a streamed message don't convert half surrogate pairs naively" in new ServerTestSetup { val gclef = "𝄞" - gclef.size shouldEqual 2 + gclef.length shouldEqual 2 // split up the code point val half1 = gclef.take(1) diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WebsocketServerSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WebsocketServerSpec.scala index d05e6d7cba..5a7a507099 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WebsocketServerSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WebsocketServerSpec.scala @@ -37,8 +37,7 @@ class WebsocketServerSpec extends FreeSpec with Matchers with WithMaterializerSp val request = expectRequest val upgrade = request.header[UpgradeToWebsocket] - upgrade.isDefined shouldBe - true + upgrade.isDefined shouldBe true val source = Source(List(1, 2, 3, 4, 5)).map(num ⇒ TextMessage.Strict(s"Message $num")) diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/WebsocketDirectivesSpec.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/WebsocketDirectivesSpec.scala index ded4bd6077..b5dda7b12a 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/WebsocketDirectivesSpec.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/WebsocketDirectivesSpec.scala @@ -10,7 +10,6 @@ import akka.http.scaladsl.model.headers.{ UpgradeProtocol, Upgrade } import akka.http.scaladsl.model.{ HttpRequest, StatusCodes, HttpResponse } import akka.http.scaladsl.model.ws.{ Message, UpgradeToWebsocket } import akka.http.scaladsl.server.{ Route, RoutingSpec } -import akka.stream.Materializer import akka.stream.scaladsl.Flow class WebsocketDirectivesSpec extends RoutingSpec {