Skip to content

Commit

Permalink
Move specs that are used in doc snippets to a separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
2m committed Jan 14, 2019
1 parent bcba72a commit 377ff4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package akka.stream.alpakka.s3.scaladsl
import akka.actor.ActorSystem
import akka.stream.alpakka.s3.S3Settings
import akka.stream.alpakka.s3.headers.ServerSideEncryption
import akka.stream.alpakka.s3.impl.S3Stream
import akka.stream.alpakka.s3.scaladsl.S3WireMockBase._
import akka.testkit.TestKit
import com.github.tomakehurst.wiremock.WireMockServer
Expand Down Expand Up @@ -414,6 +415,7 @@ abstract class S3WireMockBase(_system: ActorSystem, _wireMockServer: WireMockSer
}

def mockCopy(): Unit = mockCopy(body.length)
def mockCopyMinChunkSize(): Unit = mockCopy(S3Stream.MinChunkSize)
def mockCopy(expectedContentLength: Int): Unit = {
mock.register(
head(urlEqualTo(s"/$bucketKey"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Copyright (C) 2016-2018 Lightbend Inc. <http://www.lightbend.com>
*/

package akka.stream.alpakka.s3.scaladsl
package docs.scaladsl

import akka.NotUsed
import akka.stream.alpakka.s3.{MultipartUploadResult, S3Headers}
import akka.stream.alpakka.s3.headers.{CannedAcl, ServerSideEncryption}
import akka.stream.alpakka.s3.impl.S3Stream
import akka.stream.alpakka.s3.scaladsl.{S3, S3ClientIntegrationSpec, S3WireMockBase}
import akka.stream.alpakka.s3.{MultipartUploadResult, S3Headers}
import akka.stream.scaladsl.{Sink, Source}
import akka.util.ByteString

Expand Down Expand Up @@ -99,7 +99,7 @@ class S3SinkSpec extends S3WireMockBase with S3ClientIntegrationSpec {
}

it should "copy a file from source bucket to target bucket when expected content length is equal to chunk size" in {
mockCopy(S3Stream.MinChunkSize)
mockCopyMinChunkSize()

val result = S3.multipartCopy(bucket, bucketKey, targetBucket, targetBucketKey).run()
result.runWith(Sink.head).futureValue shouldBe MultipartUploadResult(targetUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* Copyright (C) 2016-2018 Lightbend Inc. <http://www.lightbend.com>
*/

package akka.stream.alpakka.s3.scaladsl
package docs.scaladsl

import akka.NotUsed
import akka.http.scaladsl.model.{ContentType, ContentTypes, HttpEntity, HttpResponse}
import akka.http.scaladsl.model.headers.ByteRange
import akka.http.scaladsl.model.{ContentType, ContentTypes, HttpEntity, HttpResponse}
import akka.stream.alpakka.s3._
import akka.stream.alpakka.s3.headers.ServerSideEncryption
import akka.stream.alpakka.s3.scaladsl.{S3, S3ClientIntegrationSpec, S3WireMockBase}
import akka.stream.scaladsl.{Sink, Source}
import akka.util.ByteString

Expand Down

0 comments on commit 377ff4b

Please sign in to comment.