This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 1f670625159 Refactor MySQLBinlogClientTest (#32617)
1f670625159 is described below
commit 1f67062515979ecfcc5c984e94e88fdb1686bc5f
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Aug 22 01:59:37 2024 +0800
Refactor MySQLBinlogClientTest (#32617)
* Refactor MetaDataManagerPersistService
* Refactor ITContainers
* Refactor MySQLBinlogClientTest
---
.../mysql/ingest/incremental/client/MySQLBinlogClientTest.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git
a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/MySQLBinlogClientTest.java
b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/MySQLBinlogClientTest.java
index a7d5863c9b0..dc265522f99 100644
---
a/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/MySQLBinlogClientTest.java
+++
b/kernel/data-pipeline/dialect/mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/incremental/client/MySQLBinlogClientTest.java
@@ -66,15 +66,11 @@ class MySQLBinlogClientTest {
@SuppressWarnings("unchecked")
@BeforeEach
- void setUp() throws InterruptedException {
+ void setUp() {
client = new MySQLBinlogClient(new ConnectInfo(1, "host", 3306,
"username", "password"), false);
when(channel.pipeline()).thenReturn(pipeline);
when(channel.isOpen()).thenReturn(true);
when(channel.close()).thenReturn(channelFuture);
- when(channelFuture.sync()).thenAnswer(invocation -> {
- when(channel.isOpen()).thenReturn(false);
- return null;
- });
when(channel.localAddress()).thenReturn(new InetSocketAddress("host",
3306));
when(channel.attr(MySQLConstants.SEQUENCE_ID_ATTRIBUTE_KEY)).thenReturn(mock(Attribute.class));
when(channel.attr(MySQLConstants.SEQUENCE_ID_ATTRIBUTE_KEY).get()).thenReturn(new
AtomicInteger());
@@ -152,7 +148,7 @@ class MySQLBinlogClientTest {
}
@Test
- void assertPollFailed() throws ReflectiveOperationException {
+ void assertPollOnNotRunning() throws ReflectiveOperationException {
Plugins.getMemberAccessor().set(MySQLBinlogClient.class.getDeclaredField("channel"),
client, channel);
Plugins.getMemberAccessor().set(MySQLBinlogClient.class.getDeclaredField("running"),
client, false);
assertThat(client.poll(), is(Collections.emptyList()));