Search in sources :

Example 1 with FaultyTestEntity

use of org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.FaultyTestEntity in project spring-cloud-gcp by spring-cloud.

the class ConverterAwareMappingSpannerEntityWriterTests method writeIncompatibleTypeTest.

@Test
public void writeIncompatibleTypeTest() {
    this.expectedEx.expect(SpannerDataException.class);
    this.expectedEx.expectMessage("Unsupported mapping for type: " + "class org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities$TestEntity");
    FaultyTestEntity ft = new FaultyTestEntity();
    ft.fieldWithUnsupportedType = new TestEntity();
    WriteBuilder writeBuilder = Mutation.newInsertBuilder("faulty_test_table");
    this.spannerEntityWriter.write(ft, writeBuilder::set);
}
Also used : FaultyTestEntity(org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.FaultyTestEntity) ChildTestEntity(org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.ChildTestEntity) TestEntity(org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.TestEntity) WriteBuilder(com.google.cloud.spanner.Mutation.WriteBuilder) FaultyTestEntity(org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.FaultyTestEntity) Test(org.junit.Test)

Aggregations

WriteBuilder (com.google.cloud.spanner.Mutation.WriteBuilder)1 Test (org.junit.Test)1 ChildTestEntity (org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.ChildTestEntity)1 FaultyTestEntity (org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.FaultyTestEntity)1 TestEntity (org.springframework.cloud.gcp.data.spanner.core.convert.TestEntities.TestEntity)1