Skip to content

Commit af35430

Browse files
committed
fix test
1 parent fca5e1f commit af35430

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

fluss-client/src/test/java/com/alibaba/fluss/client/security/acl/FlussAuthorizationITCase.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ void testProduceAndConsumer() throws Exception {
445445
PermissionType.ALLOW))))
446446
.all()
447447
.get();
448+
FLUSS_CLUSTER_EXTENSION.waitUtilTableReady(
449+
rootAdmin.getTableInfo(DATA1_TABLE_PATH).get().getTableId());
448450
try (Table table = guestConn.getTable(DATA1_TABLE_PATH)) {
449451
AppendWriter appendWriter = table.newAppend().createWriter();
450452
appendWriter.append(row(1, "a")).get();

fluss-rpc/src/test/java/com/alibaba/fluss/rpc/netty/authenticate/AuthenticationTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ private void buildNettyServer() throws Exception {
208208
configuration.setString(
209209
ConfigOptions.SERVER_SECURITY_PROTOCOL_MAP.key(),
210210
"CLIENT1:mutual,CLIENT2:username_password");
211-
configuration.setString("security.username_password.username", "root");
212-
configuration.setString("security.username_password.password", "password");
211+
configuration.setString("security.username_password.credentials", "root:password");
213212
// 3 worker threads is enough for this test
214213
configuration.setString(ConfigOptions.NETTY_SERVER_NUM_WORKER_THREADS.key(), "3");
215214
MetricGroup metricGroup = NOPMetricsGroup.newInstance();

fluss-rpc/src/test/java/com/alibaba/fluss/rpc/protocol/MessageCodecTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.junit.jupiter.api.BeforeEach;
4242
import org.junit.jupiter.api.Test;
4343

44+
import java.net.InetSocketAddress;
4445
import java.util.Collections;
4546

4647
import static com.alibaba.fluss.testutils.ByteBufChannel.toByteBuf;
@@ -195,6 +196,7 @@ private static ChannelHandlerContext mockChannelHandlerContext() {
195196
when(channelId.asLongText()).thenReturn("long_text");
196197
Channel channel = mock(Channel.class);
197198
when(channel.id()).thenReturn(channelId);
199+
when(channel.remoteAddress()).thenReturn(new InetSocketAddress("localhost", 8080));
198200
ChannelHandlerContext ctx = mock(ChannelHandlerContext.class);
199201
when(ctx.channel()).thenReturn(channel);
200202
EventExecutor eventExecutor = mock(EventExecutor.class);

fluss-server/src/test/java/com/alibaba/fluss/server/zk/data/ResourceAclJsonSerdeTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import java.util.Arrays;
2626
import java.util.Collections;
27-
import java.util.HashSet;
27+
import java.util.LinkedHashSet;
2828

2929
/** Test for {@link ResourceAclJsonSerde}. */
3030
public class ResourceAclJsonSerdeTest extends JsonSerdeTestBase<ResourceAcl> {
@@ -44,7 +44,8 @@ protected ResourceAcl[] createObjects() {
4444
OperationType.ALL,
4545
PermissionType.ALLOW))),
4646
new ResourceAcl(
47-
new HashSet<>(
47+
// use LinkedHashSet to ensure the order of the acls is preserved
48+
new LinkedHashSet<>(
4849
Arrays.asList(
4950
new AccessControlEntry(
5051
new FlussPrincipal("John", "ROLE"),
@@ -62,9 +63,9 @@ protected ResourceAcl[] createObjects() {
6263
@Override
6364
protected String[] expectedJsons() {
6465
return new String[] {
65-
"{\"version\":1,\"acls\":[{\"principal_type\":\"USER\",\"principal_name\":\"Mike\",\"permission_type\":\"ALLOW\",\"host\":\"*\",\"host\":\"*\",\"operation\":\"ALL\"}]}",
66-
"{\"version\":1,\"acls\":[{\"principal_type\":\"ROLE\",\"principal_name\":\"John\",\"permission_type\":\"ALLOW\",\"host\":\"127.0.0.1\",\"host\":\"127.0.0.1\",\"operation\":\"ALTER\"}"
67-
+ ",{\"principal_type\":\"ROLE\",\"principal_name\":\"Mike1233\",\"permission_type\":\"ALLOW\",\"host\":\"1*\",\"host\":\"1*\",\"operation\":\"READ\"}]}"
66+
"{\"version\":1,\"acls\":[{\"principal_type\":\"USER\",\"principal_name\":\"Mike\",\"permission_type\":\"ALLOW\",\"host\":\"*\",\"operation\":\"ALL\"}]}",
67+
"{\"version\":1,\"acls\":[{\"principal_type\":\"ROLE\",\"principal_name\":\"John\",\"permission_type\":\"ALLOW\",\"host\":\"127.0.0.1\",\"operation\":\"ALTER\"}"
68+
+ ",{\"principal_type\":\"ROLE\",\"principal_name\":\"Mike1233\",\"permission_type\":\"ALLOW\",\"host\":\"1*\",\"operation\":\"READ\"}]}"
6869
};
6970
}
7071
}

0 commit comments

Comments
 (0)