Skip to content

Commit d4da677

Browse files
committed
fix
1 parent ea7676c commit d4da677

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipePermissionIT.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.apache.iotdb.common.rpc.thrift.TSStatus;
2323
import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
2424
import org.apache.iotdb.confignode.rpc.thrift.TCreatePipeReq;
25-
import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
2625
import org.apache.iotdb.consensus.ConsensusFactory;
2726
import org.apache.iotdb.db.it.utils.TestUtils;
2827
import org.apache.iotdb.it.env.MultiEnvFactory;
@@ -39,6 +38,7 @@
3938
import org.junit.runner.RunWith;
4039

4140
import java.sql.Connection;
41+
import java.sql.ResultSet;
4242
import java.sql.SQLException;
4343
import java.sql.Statement;
4444
import java.util.Arrays;
@@ -414,15 +414,17 @@ public void testSourcePermission() {
414414
fail("Create pipe without user shall succeed if use the current session");
415415
}
416416

417-
TestUtils.executeNonQuery(senderEnv, "revoke SYSTEM on root.** from user thulab");
418-
419417
// A user shall only see its own pipe
420-
try (final SyncConfigNodeIServiceClient client =
421-
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
422-
Assert.assertEquals(
423-
1, client.showPipe(new TShowPipeReq().setUserName("thulab")).pipeInfoList.size());
418+
try (final Connection connection = senderEnv.getConnection("thulab", "passwD@123456");
419+
final Statement statement = connection.createStatement()) {
420+
// Will not throw any exception
421+
final ResultSet resultSet = statement.executeQuery("show pipes");
422+
Assert.assertTrue(resultSet.next());
423+
Assert.assertFalse(resultSet.next());
424424
} catch (Exception e) {
425425
fail(e.getMessage());
426426
}
427+
428+
TestUtils.executeNonQuery(senderEnv, "revoke SYSTEM on root.** from user thulab");
427429
}
428430
}

0 commit comments

Comments
 (0)