From 8ba2b71aebb20cefbb4e3b6ec816ac43d4404bf7 Mon Sep 17 00:00:00 2001 From: Alexandr Gorshenin Date: Wed, 10 Jun 2026 14:45:13 +0100 Subject: [PATCH] Small test on Compression validation --- .../tech/ydb/table/impl/BaseSessionTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 table/src/test/java/tech/ydb/table/impl/BaseSessionTest.java diff --git a/table/src/test/java/tech/ydb/table/impl/BaseSessionTest.java b/table/src/test/java/tech/ydb/table/impl/BaseSessionTest.java new file mode 100644 index 000000000..b25d9293e --- /dev/null +++ b/table/src/test/java/tech/ydb/table/impl/BaseSessionTest.java @@ -0,0 +1,29 @@ +package tech.ydb.table.impl; + +import org.junit.Assert; + +import tech.ydb.table.description.ColumnFamily; + +/** + * + * @author Aleksandr Gorshenin {@literal } + */ +public class BaseSessionTest { + + /** + * Verifies that the {@link ColumnFamily.Compression} enum declares exactly the expected constants: + * {@code COMPRESSION_NONE} and {@code COMPRESSION_LZ4}. + *

+ * This check matters because the values are used when mapping to and from the protobuf representation. Any change + * to the enum would break this test and signals that + * {@link BaseSession#buildColumnFamily(tech.ydb.table.description.ColumnFamily)} and + * {@link BaseSession#mapDescribeTable(tech.ydb.core.Result, tech.ydb.table.settings.DescribeTableSettings)} + * need to be updated as well. + */ + public void columnFamilyTest() { + Assert.assertArrayEquals(new ColumnFamily.Compression[] { + ColumnFamily.Compression.COMPRESSION_NONE, + ColumnFamily.Compression.COMPRESSION_LZ4 + }, ColumnFamily.Compression.values()); + } +}