@@ -0,0 +1,1828 @@
+package org.mitallast.queue.raft.resource;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.mitallast.queue.common.BaseIntegrationTest;%0Aimport org.mitallast.queue.common.settings.ImmutableSettings;%0Aimport org.mitallast.queue.common.settings.Settings;%0Aimport org.mitallast.queue.node.InternalNode;%0Aimport org.mitallast.queue.raft.state.RaftStateContext;%0Aimport org.mitallast.queue.raft.state.RaftStateType;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0Apublic class ResourceServiceTest extends BaseIntegrationTest %7B%0A    @Test%0A    public void testReopen() throws Exception %7B%0A        Settings settings = settings();%0A%0A        %7B%0A            InternalNode node = createNode(settings);%0A%0A            // await for leader election%0A            while (true) %7B%0A                Thread.sleep(TimeUnit.SECONDS.toMillis(5));%0A                if (node.injector().getInstance(RaftStateContext.class).getState() == RaftStateType.LEADER) %7B%0A                    break;%0A                %7D%0A            %7D%0A            Node path = node.injector().getInstance(ResourceService.class).create(%22path%22).get();%0A            Assert.assertNotNull(path);%0A%0A            node.stop();%0A            node.close();%0A        %7D%0A%0A        %7B%0A            InternalNode node = createNode(ImmutableSettings.builder()%0A                .put(settings)%0A                .put(%22node.name%22, %22node2%22)%0A                .build());%0A%0A            // await for leader election%0A            while (true) %7B%0A                Thread.sleep(TimeUnit.SECONDS.toMillis(5));%0A                if (node.injector().getInstance(RaftStateContext.class).getState() == RaftStateType.LEADER) %7B%0A                    break;%0A                %7D%0A            %7D%0A            Boolean pathExists = node.injector().getInstance(ResourceService.class).exists(%22path%22).get();%0A            Assert.assertTrue(pathExists);%0A        %7D%0A    %7D%0A%7D%0A

test resource service