From bc976a83066a3259ed27a74ce589dc4049504876 Mon Sep 17 00:00:00 2001 From: gvdutra Date: Wed, 7 Oct 2026 13:59:47 -0700 Subject: [PATCH] Fix ZIP entry size variable metadata --- .../main/java/org/apache/hop/core/Const.java | 5 +++-- .../core/variables/VariableRegistryTest.java | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/apache/hop/core/Const.java b/core/src/main/java/org/apache/hop/core/Const.java index 04382353aea..19b9eb19ea8 100644 --- a/core/src/main/java/org/apache/hop/core/Const.java +++ b/core/src/main/java/org/apache/hop/core/Const.java @@ -1001,7 +1001,9 @@ public static boolean toBoolean(String string) { * @see #HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT * @see #HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING */ - @Variable(description = "A variable to configure the maximum file size of a single zip entry") + @Variable( + value = "4294967295", + description = "A variable to configure the maximum file size of a single zip entry") public static final String HOP_ZIP_MAX_ENTRY_SIZE = "HOP_ZIP_MAX_ENTRY_SIZE"; /** @@ -1018,7 +1020,6 @@ public static boolean toBoolean(String string) { * @see #HOP_ZIP_MAX_ENTRY_SIZE * @see #HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT */ - @Variable(description = "") public static final String HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING = String.valueOf(HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT); diff --git a/core/src/test/java/org/apache/hop/core/variables/VariableRegistryTest.java b/core/src/test/java/org/apache/hop/core/variables/VariableRegistryTest.java index 0d16ae31044..2dc0c86d94e 100644 --- a/core/src/test/java/org/apache/hop/core/variables/VariableRegistryTest.java +++ b/core/src/test/java/org/apache/hop/core/variables/VariableRegistryTest.java @@ -17,9 +17,11 @@ package org.apache.hop.core.variables; +import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import org.apache.hop.core.Const; import org.apache.hop.core.HopClientEnvironment; @@ -50,4 +52,22 @@ void testInit() throws Exception { "Specifies the password encoder plugin to use by ID (Hop is the default).", describedVariable.getDescription()); } + + @Test + void testZipMaxEntrySizeMetadata() throws Exception { + HopClientEnvironment.init(); + TestUtil.registerTestPluginTypes(); + + VariableRegistry.init(); + VariableRegistry registry = VariableRegistry.getInstance(); + DescribedVariable describedVariable = + registry.findDescribedVariable(Const.HOP_ZIP_MAX_ENTRY_SIZE); + + assertNotNull(describedVariable); + assertAll( + () -> + assertEquals(Const.HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING, describedVariable.getValue()), + () -> assertFalse(describedVariable.getDescription().isBlank()), + () -> assertNull(registry.findDescribedVariable("HOP_ZIP_MAX_ENTRY_SIZE_DEFAULT_STRING"))); + } }