Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.core.convert.ConversionFailedException;
import org.springframework.core.convert.ConverterNotFoundException;
import org.springframework.core.convert.converter.Converter;
import org.springframework.lang.Nullable;

Expand Down Expand Up @@ -276,11 +277,15 @@ void readUnmatchableTypesTest() {
assertThatThrownBy(() -> this.spannerEntityReader.read(
FaultyTestEntity.class,
struct,
java.util.Set.of("id"),
false
null, // includeColumns = null means read all columns
true // allowMissingColumns = true prevents failing early on the missing 'id' column
))
.isInstanceOf(SpannerDataException.class)
.hasMessageContaining("Unable to read column from Cloud Spanner results");
// We expect ConverterNotFoundException because:
// 1. The missing 'id' column is allowed and does not cause a failure.
// 2. The reader proceeds to process 'fieldWithUnsupportedType'.
// 3. Since there is no converter from String to TestEntity, Spring throws ConverterNotFoundException.
.isInstanceOf(ConverterNotFoundException.class)
.hasMessageContaining("No converter found capable of converting from type");
}

@Test
Expand Down
Loading