diff --git a/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJob.java b/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJob.java index b8b4c473ee1e1..b32f57030d547 100644 --- a/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJob.java +++ b/kernel/schedule/core/src/main/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJob.java @@ -139,7 +139,7 @@ private void compareUpdateAndSendEventForTable(final String databaseName, final } private ShardingSphereSchemaDataAlteredPOJO getShardingSphereSchemaDataAlteredPOJO(final String databaseName, final String schemaName, final ShardingSphereTableData tableData, - final ShardingSphereTableData changedTableData, final ShardingSphereTable table) { + final ShardingSphereTableData changedTableData, final ShardingSphereTable table) { ShardingSphereSchemaDataAlteredPOJO result = new ShardingSphereSchemaDataAlteredPOJO(databaseName, schemaName, tableData.getName()); Map tableDataMap = tableData.getRows().stream().collect(Collectors.toMap(ShardingSphereRowData::getUniqueKey, Function.identity())); Map changedTableDataMap = changedTableData.getRows().stream().collect(Collectors.toMap(ShardingSphereRowData::getUniqueKey, Function.identity())); diff --git a/kernel/schedule/core/src/test/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobTest.java b/kernel/schedule/core/src/test/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobTest.java index c4a9d026d32cd..5a89037ae2743 100644 --- a/kernel/schedule/core/src/test/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobTest.java +++ b/kernel/schedule/core/src/test/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectJobTest.java @@ -30,6 +30,7 @@ import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereStatistics; import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereTableData; import org.apache.shardingsphere.mode.manager.ContextManager; +import org.apache.shardingsphere.mode.service.pojo.ShardingSphereSchemaDataAlteredPOJO; import org.apache.shardingsphere.test.util.PropertiesBuilder; import org.apache.shardingsphere.test.util.PropertiesBuilder.Property; import org.junit.jupiter.api.Test; @@ -40,6 +41,7 @@ import java.util.LinkedList; import java.util.Properties; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -58,7 +60,7 @@ void assertCollect() { when(contextManager.getMetaDataContexts().getMetaData().getTemporaryProps()).thenReturn(new TemporaryConfigurationProperties( PropertiesBuilder.build(new Property(TemporaryConfigurationPropertyKey.PROXY_META_DATA_COLLECTOR_ENABLED.getKey(), Boolean.TRUE.toString())))); new StatisticsCollectJob(contextManager).execute(null); - verify(contextManager).getComputeNodeInstanceContext(); + verify(contextManager.getPersistServiceFacade()).persist(any(ShardingSphereSchemaDataAlteredPOJO.class)); } private ShardingSphereStatistics mockStatistics() {