Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Atanas Atanasov <[email protected]>
  • Loading branch information
ata-nas committed Mar 4, 2025
1 parent d45677a commit 1927c9c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ void setUp() throws IOException {
final Path testLiveRootPath = testTempDir.resolve("live");
final Path testArchiveRootPath = testTempDir.resolve("archive");
final Configuration config = ConfigurationBuilder.create()
.autoDiscoverExtensions()
.withConfigDataType(PersistenceStorageConfig.class)
.withValue(PERSISTENCE_STORAGE_COMPRESSION_TYPE, "NONE")
.withValue(PERSISTENCE_STORAGE_ARCHIVE_GROUP_SIZE, String.valueOf(ARCHIVE_GROUP_SIZE))
.withValue(PERSISTENCE_STORAGE_LIVE_ROOT_PATH_KEY, testLiveRootPath)
.withValue(PERSISTENCE_STORAGE_ARCHIVE_ROOT_PATH_KEY, testArchiveRootPath)
.getOrCreateConfig();
.withValue(PERSISTENCE_STORAGE_LIVE_ROOT_PATH_KEY, testLiveRootPath.toString())
.withValue(PERSISTENCE_STORAGE_ARCHIVE_ROOT_PATH_KEY, testArchiveRootPath.toString())
.build();
persistenceStorageConfig = config.getConfigData(PersistenceStorageConfig.class);
final Path testConfigLiveRootPath = persistenceStorageConfig.liveRootPath();
assertThat(testConfigLiveRootPath).isEqualTo(testLiveRootPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

import com.hedera.block.server.Constants;
import com.hedera.block.server.config.TestConfigBuilder;
import com.hedera.block.server.persistence.storage.PersistenceStorageConfig;
import com.hedera.block.server.persistence.storage.PersistenceStorageConfig.CompressionType;
import com.swirlds.config.api.Configuration;
import com.swirlds.config.api.ConfigurationBuilder;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
Expand Down Expand Up @@ -43,15 +44,17 @@ class BlockAsLocalFilePathResolverTest {

@BeforeEach
void setUp() throws IOException {
final TestConfigBuilder configBuilder = new TestConfigBuilder(PersistenceStorageConfig.class);
testLiveRootPath = testTempDir.resolve("live");
testArchiveRootPath = testTempDir.resolve("archive");
testUnverifiedRootPath = testTempDir.resolve("unverified");
configBuilder.withValue(PERSISTENCE_STORAGE_LIVE_ROOT_PATH_KEY, testLiveRootPath.toString());
configBuilder.withValue(PERSISTENCE_STORAGE_ARCHIVE_ROOT_PATH_KEY, testArchiveRootPath.toString());
configBuilder.withValue(PERSISTENCE_STORAGE_UNVERIFIED_ROOT_PATH_KEY, testUnverifiedRootPath.toString());
configBuilder.withValue(PERSISTENCE_STORAGE_ARCHIVE_GROUP_SIZE, "10");
testConfig = configBuilder.getOrCreateConfig().getConfigData(PersistenceStorageConfig.class);
final Configuration configBuilder = ConfigurationBuilder.create()
.withConfigDataType(PersistenceStorageConfig.class)
.withValue(PERSISTENCE_STORAGE_LIVE_ROOT_PATH_KEY, testLiveRootPath.toString())
.withValue(PERSISTENCE_STORAGE_ARCHIVE_ROOT_PATH_KEY, testArchiveRootPath.toString())
.withValue(PERSISTENCE_STORAGE_UNVERIFIED_ROOT_PATH_KEY, testUnverifiedRootPath.toString())
.withValue(PERSISTENCE_STORAGE_ARCHIVE_GROUP_SIZE, "10")
.build();
testConfig = configBuilder.getConfigData(PersistenceStorageConfig.class);
final Path testConfigLiveRootPath = testConfig.liveRootPath();
assertThat(testConfigLiveRootPath).isEqualTo(testLiveRootPath);
final Path testConfigArchiveRootPath = testConfig.archiveRootPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static org.assertj.core.api.Assertions.from;
import static org.mockito.Mockito.spy;

import com.hedera.block.server.config.TestConfigBuilder;
import com.hedera.block.server.persistence.storage.PersistenceStorageConfig;
import com.hedera.block.server.persistence.storage.compression.Compression;
import com.hedera.block.server.persistence.storage.compression.NoOpCompression;
Expand All @@ -20,6 +19,7 @@
import com.hedera.hapi.block.stream.output.BlockHeader;
import com.hedera.pbj.runtime.ParseException;
import com.swirlds.config.api.Configuration;
import com.swirlds.config.api.ConfigurationBuilder;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -49,10 +49,11 @@ class BlockAsLocalFileReaderTest {
@BeforeEach
void setUp() throws IOException {
final Path testLiveRootPath = testTempDir.resolve("live");
final Configuration config = new TestConfigBuilder(PersistenceStorageConfig.class)
final Configuration config = ConfigurationBuilder.create()
.withConfigDataType(PersistenceStorageConfig.class)
.withValue(PERSISTENCE_STORAGE_COMPRESSION_TYPE, "NONE")
.withValue(PERSISTENCE_STORAGE_LIVE_ROOT_PATH_KEY, testLiveRootPath)
.getOrCreateConfig();
.withValue(PERSISTENCE_STORAGE_LIVE_ROOT_PATH_KEY, testLiveRootPath.toString())
.build();
final PersistenceStorageConfig persistenceStorageConfig = config.getConfigData(PersistenceStorageConfig.class);
final Path testConfigLiveRootPath = persistenceStorageConfig.liveRootPath();
assertThat(testConfigLiveRootPath).isEqualTo(testLiveRootPath);
Expand Down

0 comments on commit 1927c9c

Please sign in to comment.