final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
final Configuration config = new ConfigurationImpl(moduleShardsConfig, modulesConfig);
- datastoreContextBuilder.dataStoreName(typeName);
+ setDataStoreName(typeName);
final DatastoreContext datastoreContext = datastoreContextBuilder.build();
final DatastoreContextFactory mockContextFactory = Mockito.mock(DatastoreContextFactory.class);
return dataStore;
}
+ private void setDataStoreName(String typeName) {
+ if ("config".equals(typeName)) {
+ datastoreContextBuilder.logicalStoreType(LogicalDatastoreType.CONFIGURATION);
+ } else if ("operational".equals(typeName)) {
+ datastoreContextBuilder.logicalStoreType(LogicalDatastoreType.OPERATIONAL);
+ } else {
+ datastoreContextBuilder.dataStoreName(typeName);
+ }
+ }
+
public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName,
final SchemaContext schemaContext) {
final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
final ConfigurationImpl configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider());
- getDatastoreContextBuilder().dataStoreName(typeName);
+ setDataStoreName(typeName);
final DatastoreContext datastoreContext = getDatastoreContextBuilder().build();
final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
final ConfigurationImpl configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider());
- getDatastoreContextBuilder().dataStoreName(typeName);
+ setDataStoreName(typeName);
final DatastoreContext datastoreContext =
getDatastoreContextBuilder().logicalStoreType(storeType).build();