From 33e13eeb2e409b1001f8b720eaf070a0143e1552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bobowski?= Date: Fri, 20 Sep 2024 14:07:01 +0200 Subject: [PATCH] SNOW-1658905 Fix null pointer --- .../iceberg/IcebergTableSchemaValidatorIT.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergTableSchemaValidatorIT.java b/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergTableSchemaValidatorIT.java index 249bde3c6..abc8bca8e 100644 --- a/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergTableSchemaValidatorIT.java +++ b/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergTableSchemaValidatorIT.java @@ -3,6 +3,7 @@ import com.snowflake.kafka.connector.internal.TestUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -10,11 +11,17 @@ public class IcebergTableSchemaValidatorIT extends BaseIcebergIT { private static final String TEST_ROLE = "testrole_kafka"; - private static final IcebergTableSchemaValidator schemaValidator = - new IcebergTableSchemaValidator(conn); + private static IcebergTableSchemaValidator schemaValidator; private String tableName; + @BeforeAll + // overrides the base class @BeforeAll + public static void setup() { + conn = TestUtils.getConnectionServiceForStreaming(); + schemaValidator = new IcebergTableSchemaValidator(conn); + } + @BeforeEach public void setUp() { tableName = TestUtils.randomTableName();