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 4f368dfba9b Add more test cases on mode module (#37635)
4f368dfba9b is described below
commit 4f368dfba9b8e08a423dec63937a1d3eea17c9bf
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jan 4 19:05:25 2026 +0800
Add more test cases on mode module (#37635)
* Add more SQL parser test cases on Doris
* Add more test cases on mode module
---
.../path/engine/searcher/NodePathSearcherTest.java | 80 ++++++++++++++++++++++
.../process/InstanceProcessNodeValueTest.java | 31 +++++++++
.../TableCoordinatorTypeNodePathTest.java | 43 ++++++++++++
.../mode/node/rule/tuple/RuleNodeTupleTest.java | 43 ++++++++++++
.../RuleTypeConfigurationChangedHandlerTest.java | 35 ++++++++++
.../ClusterPersistServiceFacadeBuilderTest.java | 39 +++++++++++
.../StandaloneExclusiveOperatorContextTest.java | 58 ++++++++++++++++
.../StandalonePersistServiceFacadeBuilderTest.java | 39 +++++++++++
.../StandaloneComputeNodePersistServiceTest.java | 37 ++++++++++
9 files changed, 405 insertions(+)
diff --git
a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/engine/searcher/NodePathSearcherTest.java
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/engine/searcher/NodePathSearcherTest.java
new file mode 100644
index 00000000000..cde6a9708e8
--- /dev/null
+++
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/engine/searcher/NodePathSearcherTest.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.node.path.engine.searcher;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.mode.node.path.NodePath;
+import org.apache.shardingsphere.mode.node.path.NodePathEntity;
+import org.junit.jupiter.api.Test;
+
+import java.util.Optional;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class NodePathSearcherTest {
+
+ @Test
+ void assertFindReturnsEmptyWhenPathNotMatched() {
+ NodePathSearchCriteria criteria = new NodePathSearchCriteria(new
SearchExampleNodePath(NodePathPattern.IDENTIFIER, NodePathPattern.IDENTIFIER),
false, 1);
+ Optional<String> actual = NodePathSearcher.find("/invalid/path",
criteria);
+ assertFalse(actual.isPresent());
+ }
+
+ @Test
+ void assertGetReturnsMatchedSegment() {
+ NodePathSearchCriteria criteria = new NodePathSearchCriteria(new
SearchExampleNodePath(NodePathPattern.IDENTIFIER, NodePathPattern.IDENTIFIER),
false, 2);
+ String actual = NodePathSearcher.get("/search/foo/child/bar",
criteria);
+ assertThat(actual, is("bar"));
+ }
+
+ @Test
+ void assertGetThrowsExceptionWhenNotMatched() {
+ NodePathSearchCriteria criteria = new NodePathSearchCriteria(new
SearchExampleNodePath(NodePathPattern.IDENTIFIER, NodePathPattern.IDENTIFIER),
false, 1);
+ IllegalArgumentException actual =
assertThrows(IllegalArgumentException.class, () ->
NodePathSearcher.get("/search/foo", criteria));
+ assertThat(actual.getMessage(), is("Can not find node segment in path:
/search/foo"));
+ }
+
+ @Test
+ void assertIsMatchedPathWhenContainsChildPath() {
+ NodePathSearchCriteria criteria = new NodePathSearchCriteria(new
SearchExampleNodePath(NodePathPattern.IDENTIFIER, NodePathPattern.IDENTIFIER),
true, 1);
+ boolean actual =
NodePathSearcher.isMatchedPath("/search/foo/child/bar/extra", criteria);
+ assertTrue(actual);
+ }
+
+ @Test
+ void assertIsMatchedPathReturnsFalseWhenPathMismatch() {
+ NodePathSearchCriteria criteria = new NodePathSearchCriteria(new
SearchExampleNodePath(NodePathPattern.IDENTIFIER, NodePathPattern.IDENTIFIER),
true, 1);
+ boolean actual = NodePathSearcher.isMatchedPath("/mismatch/foo",
criteria);
+ assertFalse(actual);
+ }
+
+ @NodePathEntity("/search/${first}/child/${second}")
+ @RequiredArgsConstructor
+ @Getter
+ private static final class SearchExampleNodePath implements NodePath {
+
+ private final String first;
+
+ private final String second;
+ }
+}
diff --git
a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/type/global/node/compute/process/InstanceProcessNodeValueTest.java
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/type/global/node/compute/process/InstanceProcessNodeValueTest.java
new file mode 100644
index 00000000000..23192505b61
--- /dev/null
+++
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/type/global/node/compute/process/InstanceProcessNodeValueTest.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.mode.node.path.type.global.node.compute.process;
+
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+class InstanceProcessNodeValueTest {
+
+ @Test
+ void assertToStringValue() {
+ assertThat(new InstanceProcessNodeValue("foo_instance",
"foo_process").toString(), is("foo_instance:foo_process"));
+ }
+}
diff --git
a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/type/global/state/coordinator/TableCoordinatorTypeNodePathTest.java
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/type/global/state/coordinator/TableCoordinatorTypeNodePathTest.java
new file mode 100644
index 00000000000..50d0aceafcf
--- /dev/null
+++
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/path/type/global/state/coordinator/TableCoordinatorTypeNodePathTest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.node.path.type.global.state.coordinator;
+
+import
org.apache.shardingsphere.mode.node.path.engine.generator.NodePathGenerator;
+import
org.apache.shardingsphere.mode.node.path.engine.searcher.NodePathSearcher;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+class TableCoordinatorTypeNodePathTest {
+
+ @Test
+ void assertCreateTableSearchCriteria() {
+ String actual =
NodePathSearcher.get("/states/coordinator/schemas/table/foo_db.foo_schema.foo_table/READY",
TableCoordinatorTypeNodePath.createTableSearchCriteria());
+ assertThat(actual, is("foo_db.foo_schema.foo_table"));
+ }
+
+ @Test
+ void assertToPath() {
+ TableCoordinatorTypeNodePath actual = new
TableCoordinatorTypeNodePath("foo_db.foo_schema.foo_table", "LOCKED");
+ String actualPath = NodePathGenerator.toPath(actual);
+ assertThat(actual.getQualifiedTableName(),
is("foo_db.foo_schema.foo_table"));
+ assertThat(actual.getCoordinatorType(), is("LOCKED"));
+ assertThat(actualPath,
is("/states/coordinator/schemas/table/foo_db.foo_schema.foo_table/LOCKED"));
+ }
+}
diff --git
a/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/RuleNodeTupleTest.java
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/RuleNodeTupleTest.java
new file mode 100644
index 00000000000..cf7b0949781
--- /dev/null
+++
b/mode/node/src/test/java/org/apache/shardingsphere/mode/node/rule/tuple/RuleNodeTupleTest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.node.rule.tuple;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.mode.node.path.NodePath;
+import org.apache.shardingsphere.mode.node.path.NodePathEntity;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+class RuleNodeTupleTest {
+
+ @Test
+ void assertGetPath() {
+ assertThat(new RuleNodeTuple(new RulePath("foo_rule"),
"rule_content").getPath(), is("/rules/foo_rule"));
+ }
+
+ @NodePathEntity("/rules/${name}")
+ @RequiredArgsConstructor
+ @Getter
+ private static final class RulePath implements NodePath {
+
+ private final String name;
+ }
+}
diff --git
a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/dispatch/handler/database/rule/type/RuleTypeConfigurationChangedHandlerTest.java
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/dispatch/handler/database/rule/type/RuleTypeConfigurationChangedHandlerTest.java
new file mode 100644
index 00000000000..1d2eb66d22a
--- /dev/null
+++
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/dispatch/handler/database/rule/type/RuleTypeConfigurationChangedHandlerTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package
org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.rule.type;
+
+import org.apache.shardingsphere.mode.node.path.NodePath;
+import
org.apache.shardingsphere.mode.node.path.engine.generator.NodePathGenerator;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.mock;
+
+class RuleTypeConfigurationChangedHandlerTest {
+
+ @Test
+ void assertGetSubscribedNodePath() {
+ NodePath actual = new
RuleTypeConfigurationChangedHandler(mock()).getSubscribedNodePath("foo_db");
+ assertThat(NodePathGenerator.toPath(actual),
is("/metadata/foo_db/rules/([\\w-]+)"));
+ }
+}
diff --git
a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/facade/ClusterPersistServiceFacadeBuilderTest.java
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/facade/ClusterPersistServiceFacadeBuilderTest.java
new file mode 100644
index 00000000000..c2815c6ddf2
--- /dev/null
+++
b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/persist/facade/ClusterPersistServiceFacadeBuilderTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.manager.cluster.persist.facade;
+
+import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
+import org.apache.shardingsphere.mode.metadata.manager.MetaDataContextManager;
+import
org.apache.shardingsphere.mode.persist.mode.ModePersistServiceFacadeBuilder;
+import
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.isA;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.mock;
+
+class ClusterPersistServiceFacadeBuilderTest {
+
+ private final ModePersistServiceFacadeBuilder builder =
TypedSPILoader.getService(ModePersistServiceFacadeBuilder.class, "Cluster");
+
+ @Test
+ void assertBuild() {
+ assertThat(builder.build(mock(MetaDataContextManager.class,
RETURNS_DEEP_STUBS), mock(ClusterPersistRepository.class)),
isA(ClusterPersistServiceFacade.class));
+ }
+}
diff --git
a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/exclusive/StandaloneExclusiveOperatorContextTest.java
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/exclusive/StandaloneExclusiveOperatorContextTest.java
new file mode 100644
index 00000000000..7216b885de9
--- /dev/null
+++
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/exclusive/StandaloneExclusiveOperatorContextTest.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.manager.standalone.exclusive;
+
+import lombok.SneakyThrows;
+import org.junit.jupiter.api.Test;
+import org.mockito.internal.configuration.plugins.Plugins;
+
+import java.util.Collection;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class StandaloneExclusiveOperatorContextTest {
+
+ @Test
+ void assertStartReturnsTrueWhenKeyAbsent() {
+ assertTrue(new
StandaloneExclusiveOperatorContext().start("operation-key", 50L));
+ }
+
+ @Test
+ void assertStartReturnsFalseWhenKeyExists() {
+ StandaloneExclusiveOperatorContext context = new
StandaloneExclusiveOperatorContext();
+ Collection<String> existingKeys = getExclusiveOperationKeys(context);
+ existingKeys.add("duplicated-key");
+ assertFalse(context.start("duplicated-key", 0L));
+ }
+
+ @Test
+ void assertStopRemovesOperationKey() {
+ StandaloneExclusiveOperatorContext context = new
StandaloneExclusiveOperatorContext();
+ Collection<String> existingKeys = getExclusiveOperationKeys(context);
+ existingKeys.add("stopped-key");
+ context.stop("stopped-key");
+ assertTrue(existingKeys.isEmpty());
+ }
+
+ @SuppressWarnings("unchecked")
+ @SneakyThrows(ReflectiveOperationException.class)
+ private Collection<String> getExclusiveOperationKeys(final
StandaloneExclusiveOperatorContext context) {
+ return (Collection<String>)
Plugins.getMemberAccessor().get(StandaloneExclusiveOperatorContext.class.getDeclaredField("exclusiveOperationKeys"),
context);
+ }
+}
diff --git
a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/facade/StandalonePersistServiceFacadeBuilderTest.java
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/facade/StandalonePersistServiceFacadeBuilderTest.java
new file mode 100644
index 00000000000..1a4c7589cc3
--- /dev/null
+++
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/facade/StandalonePersistServiceFacadeBuilderTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.manager.standalone.persist.facade;
+
+import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
+import org.apache.shardingsphere.mode.metadata.manager.MetaDataContextManager;
+import
org.apache.shardingsphere.mode.persist.mode.ModePersistServiceFacadeBuilder;
+import org.apache.shardingsphere.mode.spi.repository.PersistRepository;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.isA;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.mock;
+
+class StandalonePersistServiceFacadeBuilderTest {
+
+ private final ModePersistServiceFacadeBuilder builder =
TypedSPILoader.getService(ModePersistServiceFacadeBuilder.class, "Standalone");
+
+ @Test
+ void assertBuild() {
+ assertThat(builder.build(mock(MetaDataContextManager.class,
RETURNS_DEEP_STUBS), mock(PersistRepository.class)),
isA(StandalonePersistServiceFacade.class));
+ }
+}
diff --git
a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneComputeNodePersistServiceTest.java
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneComputeNodePersistServiceTest.java
new file mode 100644
index 00000000000..c9367ce7bfe
--- /dev/null
+++
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneComputeNodePersistServiceTest.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.manager.standalone.persist.service;
+
+import org.apache.shardingsphere.infra.instance.ComputeNodeInstance;
+import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collections;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.mock;
+
+class StandaloneComputeNodePersistServiceTest {
+
+ @Test
+ void assertLoadAllInstances() {
+ ComputeNodeInstance computeNodeInstance = new
ComputeNodeInstance(mock(InstanceMetaData.class));
+ assertThat(new
StandaloneComputeNodePersistService(computeNodeInstance).loadAllInstances(),
is(Collections.singleton(computeNodeInstance)));
+ }
+}