-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #756 from adzerk/file-descriptor-uri
Add a `uri` method to `FileDescriptor`
- Loading branch information
Showing
7 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
io/src/test/scala/com/kevel/apso/io/S3FileDescriptorSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.kevel.apso.io | ||
|
||
import java.net.URI | ||
|
||
import org.specs2.mutable.Specification | ||
|
||
class S3FileDescriptorSpec extends Specification { | ||
"A S3FileDescriptor" should { | ||
"have a correct URI that exposes the full path" in { | ||
val file = S3FileDescriptor("bucket/key") | ||
file.uri ==== new URI("s3://bucket/key") | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
io/src/test/scala/com/kevel/apso/io/SftpFileDescriptorSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.kevel.apso.io | ||
|
||
import java.net.URI | ||
|
||
import org.specs2.mutable.Specification | ||
|
||
import com.kevel.apso.io.config.Credentials | ||
|
||
class SftpFileDescriptorSpec extends Specification { | ||
"A SftpFileDescriptor" should { | ||
"have a correct URI that exposes the full path" in { | ||
val file = SftpFileDescriptor( | ||
"localhost/tmp/file", | ||
Credentials.Sftp(default = Some(Credentials.Sftp.Entry.Basic(username = "user123", password = "pass456"))) | ||
) | ||
file.uri ==== new URI("sftp://user123@localhost/tmp/file") | ||
} | ||
} | ||
} |