33
33
34
34
public class ScramSha1SaslAuthenticatorTest {
35
35
private TestInternalConnection connection ;
36
- private MongoCredential credential ;
37
36
private ScramSha1Authenticator subject ;
38
37
private ConnectionDescription connectionDescription ;
39
38
@@ -42,14 +41,15 @@ public void before() {
42
41
this .connection = new TestInternalConnection (new ServerId (new ClusterId (), new ServerAddress ("localhost" , 27017 )));
43
42
connectionDescription = new ConnectionDescription (new ServerId (new ClusterId (), new ServerAddress ()));
44
43
// User name contains ",' and '=" to test user name prepping required by the RFC
45
- this .credential = MongoCredential .createScramSha1Credential ("u,ser=" , "database" , "pencil" .toCharArray ());
44
+ MongoCredential credential = MongoCredential .createScramSha1Credential ("u,ser=" , "database" ,
45
+ "pencil" .toCharArray ());
46
46
ScramSha1Authenticator .RandomStringGenerator randomStringGenerator = new ScramSha1Authenticator .RandomStringGenerator () {
47
47
@ Override
48
48
public String generate (final int length ) {
49
49
return "fyko+d2lbbFgONRv9qkxdawL" ;
50
50
}
51
51
};
52
- this .subject = new ScramSha1Authenticator (this . credential , randomStringGenerator );
52
+ this .subject = new ScramSha1Authenticator (credential , randomStringGenerator );
53
53
}
54
54
55
55
@ Test
@@ -65,7 +65,7 @@ public void testAuthenticateThrowsWhenServerProvidesAnInvalidRValue() {
65
65
}
66
66
67
67
@ Test
68
- public void testAuthenticateThrowsWhenServerProvidesAnInvalidRValueAsync () throws InterruptedException {
68
+ public void testAuthenticateThrowsWhenServerProvidesAnInvalidRValueAsync () {
69
69
enqueueInvalidRValueReply ();
70
70
71
71
try {
@@ -103,7 +103,7 @@ public void testAuthenticateThrowsWhenServerProvidesInvalidServerSignature() {
103
103
}
104
104
105
105
@ Test
106
- public void testAuthenticateThrowsWhenServerProvidesInvalidServerSignatureAsync () throws InterruptedException {
106
+ public void testAuthenticateThrowsWhenServerProvidesInvalidServerSignatureAsync () {
107
107
enqueueInvalidServerSignature ();
108
108
109
109
try {
0 commit comments