mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
15 hours ago 655132fb059cfa70fb338d54f1bb0fb48198fb0f
opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java
@@ -12,6 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2015-2016 ForgeRock AS.
 * Portions Copyright 2026 3A Systems, LLC.
 */
package org.opends.server.backends.pluggable;
@@ -125,7 +126,8 @@
        cryptoSuite);
  }
  static final class DummyWriteableTransaction implements WriteableTransaction {
  /** Not final: a test that needs a storage to fail, or to behave as one engine does, subclasses it. */
  static class DummyWriteableTransaction implements WriteableTransaction {
    private final Map<TreeName, TreeMap<ByteString, ByteString>> storage = new HashMap<>();
@@ -249,9 +251,20 @@
    }
    @Override
    public boolean treeExists(TreeName treeName)
    {
      return storage.containsKey(treeName);
    }
    @Override
    public void openTree(TreeName name, boolean createOnDemand)
    {
      storage.put(name, new TreeMap<ByteString, ByteString>());
      // Honours createOnDemand, and leaves an already open tree alone rather than replacing it with
      // an empty one, so that a caller opening the same tree twice does not silently lose its records.
      if (createOnDemand)
      {
        storage.putIfAbsent(name, new TreeMap<ByteString, ByteString>());
      }
    }
    @Override