Skip to content

Commit ad06fac

Browse files
[test] Fix MockMutableAuthenticationState implementation
When #19519 was cherry-picked to branch-2.11, it did not implement the authenticate method in the MockMutableAuthenticationState, which led to several test failures in the ServerCnxTest class. This commit fixes those tests. Note that the issue is only in the test code.
1 parent 6bc3530 commit ad06fac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/MockMutableAuthenticationState.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.apache.pulsar.broker.auth;
2020

2121
import static java.nio.charset.StandardCharsets.UTF_8;
22+
import java.util.concurrent.ExecutionException;
2223
import javax.naming.AuthenticationException;
2324
import java.util.concurrent.CompletableFuture;
2425
import org.apache.pulsar.broker.authentication.AuthenticationDataCommand;
@@ -47,7 +48,11 @@ public String getAuthRole() throws AuthenticationException {
4748

4849
@Override
4950
public AuthData authenticate(AuthData authData) throws AuthenticationException {
50-
return null;
51+
try {
52+
return this.authenticateAsync(authData).get();
53+
} catch (InterruptedException | ExecutionException e) {
54+
throw new RuntimeException(e);
55+
}
5156
}
5257

5358
/**

0 commit comments

Comments
 (0)