From 15f395a8e01f315253e543820a5442c0ad2b8b08 Mon Sep 17 00:00:00 2001 From: carm Date: Thu, 26 Jun 2025 03:04:21 +0800 Subject: [PATCH] test(record): Add testcase for nullable values. --- features/record/src/test/java/RecordTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/features/record/src/test/java/RecordTest.java b/features/record/src/test/java/RecordTest.java index 1f0c652..74c15f6 100644 --- a/features/record/src/test/java/RecordTest.java +++ b/features/record/src/test/java/RecordTest.java @@ -4,6 +4,7 @@ import cc.carm.lib.configuration.source.ConfigurationHolder; import cc.carm.lib.configuration.source.temp.TempConfigFactory; import cc.carm.lib.configuration.value.standard.ConfiguredValue; import cc.carm.lib.configured.adapter.record.RecordAdapter; +import org.jetbrains.annotations.Nullable; import org.junit.Test; import java.util.Arrays; @@ -20,7 +21,7 @@ public class RecordTest { "device1", "My Device", UUID.fromString("123e4567-e89b-12d3-a456-426614174000"), - new Chip("chip1", "SN123456"), + new Chip("chip1", null), Arrays.asList( new User("Alice", 30), new User("Bob", 25) @@ -97,7 +98,7 @@ public class RecordTest { Map connections) { } - record Chip(String id, String serialNumber) { + record Chip(String id, @Nullable String serialNumber) { }