-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 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
32 changes: 32 additions & 0 deletions
32
...src/test/java/org/ndx/aadarchi/vfs/github/TestFor345_Fail_When_Using_Repository_Path.java
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,32 @@ | ||
package org.ndx.aadarchi.vfs.github; | ||
|
||
import java.io.IOException; | ||
import java.nio.charset.Charset; | ||
|
||
import org.apache.commons.vfs2.FileObject; | ||
import org.apache.commons.vfs2.FileSystemException; | ||
import org.apache.commons.vfs2.FileSystemOptions; | ||
import org.apache.commons.vfs2.VFS; | ||
import org.apache.commons.vfs2.auth.StaticUserAuthenticator; | ||
import org.apache.commons.vfs2.impl.DefaultFileSystemConfigBuilder; | ||
import org.assertj.core.api.Assertions; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class TestFor345_Fail_When_Using_Repository_Path { | ||
private static FileSystemOptions authenticationOptions; | ||
|
||
@BeforeAll public static void putGitHubCredentialsInAuth() { | ||
String token = System.getProperty("aadarchi.github.token"); | ||
StaticUserAuthenticator auth = new StaticUserAuthenticator("github.com", | ||
null, token); | ||
authenticationOptions = new FileSystemOptions(); | ||
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(authenticationOptions, auth); | ||
} | ||
|
||
@Test | ||
void can_have_file_object_when_repo_path_is_given() throws FileSystemException { | ||
FileObject rootFile = VFS.getManager().resolveFile(GitHubFileProvider.urlFor("https://github.com/Riduidel/aadarchi.git"), authenticationOptions); | ||
Assertions.assertThat((Object) rootFile).isNotNull(); | ||
} | ||
} |