22
22
import java .nio .file .Files ;
23
23
import java .nio .file .attribute .BasicFileAttributes ;
24
24
import java .util .ArrayList ;
25
- import java .util .Arrays ;
25
+ import java .util .Collections ;
26
26
import java .util .List ;
27
27
28
28
import org .apache .hadoop .conf .Configuration ;
35
35
import org .apache .hadoop .test .GenericTestUtils ;
36
36
37
37
import static org .apache .hadoop .test .PlatformAssumptions .assumeNotWindows ;
38
- import org .apache .sshd .common .NamedFactory ;
39
- import org .apache .sshd .server .Command ;
40
38
import org .apache .sshd .server .SshServer ;
41
- import org .apache .sshd .server .auth .UserAuth ;
39
+ import org .apache .sshd .server .auth .UserAuthFactory ;
42
40
import org .apache .sshd .server .auth .password .PasswordAuthenticator ;
43
41
import org .apache .sshd .server .auth .password .UserAuthPasswordFactory ;
44
42
import org .apache .sshd .server .keyprovider .SimpleGeneratorHostKeyProvider ;
45
43
import org .apache .sshd .server .session .ServerSession ;
46
- import org .apache .sshd .server .subsystem .sftp .SftpSubsystemFactory ;
47
-
48
- import org .junit .After ;
49
- import org .junit .AfterClass ;
44
+ import org .apache .sshd .sftp .server .SftpSubsystemFactory ;
50
45
51
46
import static org .assertj .core .api .Assertions .assertThat ;
52
47
import static org .junit .Assert .assertArrayEquals ;
53
48
import static org .junit .Assert .assertEquals ;
54
49
import static org .junit .Assert .assertFalse ;
55
50
import static org .junit .Assert .assertNotNull ;
56
51
import static org .junit .Assert .assertTrue ;
52
+ import org .junit .After ;
53
+ import org .junit .AfterClass ;
57
54
import org .junit .Before ;
58
55
import org .junit .BeforeClass ;
59
56
import org .junit .Rule ;
@@ -82,8 +79,7 @@ private static void startSshdServer() throws IOException {
82
79
sshd .setPort (0 );
83
80
sshd .setKeyPairProvider (new SimpleGeneratorHostKeyProvider ());
84
81
85
- List <NamedFactory <UserAuth >> userAuthFactories =
86
- new ArrayList <NamedFactory <UserAuth >>();
82
+ List <UserAuthFactory > userAuthFactories = new ArrayList <>();
87
83
userAuthFactories .add (new UserAuthPasswordFactory ());
88
84
89
85
sshd .setUserAuthFactories (userAuthFactories );
@@ -100,7 +96,7 @@ public boolean authenticate(String username, String password,
100
96
});
101
97
102
98
sshd .setSubsystemFactories (
103
- Arrays .< NamedFactory < Command >> asList (new SftpSubsystemFactory ()));
99
+ Collections . singletonList (new SftpSubsystemFactory ()));
104
100
105
101
sshd .start ();
106
102
port = sshd .getPort ();
0 commit comments