diff --git a/src/main/scala/net/kemitix/s3thorp/awssdk/S3Client.scala b/src/main/scala/net/kemitix/s3thorp/awssdk/S3Client.scala index e5ea8d8..713880d 100644 --- a/src/main/scala/net/kemitix/s3thorp/awssdk/S3Client.scala +++ b/src/main/scala/net/kemitix/s3thorp/awssdk/S3Client.scala @@ -15,7 +15,7 @@ trait S3Client { object S3Client { val defaultClient: S3Client = - new ThropS3Client( + new ThorpS3Client( S3CatsIOClient(new JavaClientWrapper {}.underlying)) } \ No newline at end of file diff --git a/src/main/scala/net/kemitix/s3thorp/awssdk/ThropS3Client.scala b/src/main/scala/net/kemitix/s3thorp/awssdk/ThorpS3Client.scala similarity index 93% rename from src/main/scala/net/kemitix/s3thorp/awssdk/ThropS3Client.scala rename to src/main/scala/net/kemitix/s3thorp/awssdk/ThorpS3Client.scala index 934e2ca..8ba970f 100644 --- a/src/main/scala/net/kemitix/s3thorp/awssdk/ThropS3Client.scala +++ b/src/main/scala/net/kemitix/s3thorp/awssdk/ThorpS3Client.scala @@ -6,7 +6,7 @@ import net.kemitix.s3thorp.Sync._ import software.amazon.awssdk.core.async.AsyncRequestBody import software.amazon.awssdk.services.s3.model.{HeadObjectRequest, PutObjectRequest} -private class ThropS3Client(s3Client: S3CatsIOClient) extends S3Client { +private class ThorpS3Client(s3Client: S3CatsIOClient) extends S3Client { def objectHead(bucket: Bucket, remoteKey: RemoteKey) = { val request = HeadObjectRequest.builder().bucket(bucket).key(remoteKey).build() diff --git a/src/test/scala/net/kemitix/s3thorp/awssdk/S3ClientSuite.scala b/src/test/scala/net/kemitix/s3thorp/awssdk/S3ClientSuite.scala index e4d63c0..14a94ec 100644 --- a/src/test/scala/net/kemitix/s3thorp/awssdk/S3ClientSuite.scala +++ b/src/test/scala/net/kemitix/s3thorp/awssdk/S3ClientSuite.scala @@ -19,7 +19,7 @@ class S3ClientSuite extends FunSpec { describe("when underlying client response is okay") { val expectedHash = "hash" val expectedLastModified = Instant.now - val s3Client = new ThropS3Client(new S3CatsIOClient with JavaClientWrapper { + val s3Client = new ThorpS3Client(new S3CatsIOClient with JavaClientWrapper { override def headObject(headObjectRequest: HeadObjectRequest) = IO(HeadObjectResponse.builder(). eTag(expectedHash). @@ -32,7 +32,7 @@ class S3ClientSuite extends FunSpec { } describe("when underlying client throws NoSuchKeyException") { - val s3Client = new ThropS3Client(new S3CatsIOClient with JavaClientWrapper { + val s3Client = new ThorpS3Client(new S3CatsIOClient with JavaClientWrapper { override def headObject(headObjectRequest: HeadObjectRequest) = IO(throw NoSuchKeyException.builder().build()) }) @@ -44,11 +44,11 @@ class S3ClientSuite extends FunSpec { } describe("upload") { - def invoke(s3Client: ThropS3Client, localFile: LocalFile, bucket: Bucket, remoteKey: RemoteKey) = + def invoke(s3Client: ThorpS3Client, localFile: LocalFile, bucket: Bucket, remoteKey: RemoteKey) = s3Client.upload(localFile, bucket, remoteKey).unsafeRunSync describe("when uploading a file") { val md5Hash = "the-md5hash" - val s3Client = new ThropS3Client( + val s3Client = new ThorpS3Client( new S3CatsIOClient with JavaClientWrapper { override def putObject(putObjectRequest: PutObjectRequest, requestBody: RB) = IO(PutObjectResponse.builder().eTag(md5Hash).build())