From ba7ba6fb46ec6ebf0630b89841684809556ff315 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 28 Oct 2024 18:11:51 +0800 Subject: [PATCH] Add more test cases on MaskMergedResult (#33439) --- .../mask/merge/dql/MaskMergedResultTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/features/mask/core/src/test/java/org/apache/shardingsphere/mask/merge/dql/MaskMergedResultTest.java b/features/mask/core/src/test/java/org/apache/shardingsphere/mask/merge/dql/MaskMergedResultTest.java index 4f180c4d73fca..12c599e4593ed 100644 --- a/features/mask/core/src/test/java/org/apache/shardingsphere/mask/merge/dql/MaskMergedResultTest.java +++ b/features/mask/core/src/test/java/org/apache/shardingsphere/mask/merge/dql/MaskMergedResultTest.java @@ -27,6 +27,8 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; import java.io.InputStream; import java.io.Reader; @@ -46,6 +48,7 @@ import static org.mockito.Mockito.RETURNS_DEEP_STUBS; @ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) class MaskMergedResultTest { @Mock @@ -58,6 +61,11 @@ void assertNext() throws SQLException { @Test void assertGetValue() throws SQLException { + assertNull(new MaskMergedResult(mockMaskRule(), mockSelectStatementContext(), mergedResult).getValue(1, String.class)); + } + + @Test + void assertGetValueWithNull() throws SQLException { when(mergedResult.getValue(1, Object.class)).thenReturn("VALUE"); assertThat(new MaskMergedResult(mockMaskRule(), mockSelectStatementContext(), mergedResult).getValue(1, String.class), is("MASK_VALUE")); }