mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-01 15:47:01 +08:00
Add shutdown hook in StatemachineSnapshotFileGeneratorTest
This commit is contained in:
+7
@@ -16,10 +16,12 @@
|
||||
*/
|
||||
package org.apache.rocketmq.controller.impl.controller.impl.statemachine;
|
||||
|
||||
import org.apache.rocketmq.common.UtilAll;
|
||||
import org.apache.rocketmq.controller.impl.manager.BrokerInfo;
|
||||
import org.apache.rocketmq.controller.impl.manager.ReplicasInfoManager;
|
||||
import org.apache.rocketmq.controller.impl.manager.SyncStateInfo;
|
||||
import org.apache.rocketmq.controller.impl.statemachine.StatemachineSnapshotFileGenerator;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -75,6 +77,11 @@ public class StatemachineSnapshotFileGeneratorTest {
|
||||
this.snapshotGenerator = new StatemachineSnapshotFileGenerator(Collections.singletonList(this.replicasInfoManager));
|
||||
}
|
||||
|
||||
@After
|
||||
public void shutdown() {
|
||||
UtilAll.deleteFile(new File(this.snapshotPath));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGenerateAndLoadEmptySnapshot() throws IOException {
|
||||
ReplicasInfoManager emptyManager = new ReplicasInfoManager(null);
|
||||
|
||||
Reference in New Issue
Block a user