Search in sources :

Example 1 with SpannerEntityProcessor

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

the class SpannerStatementQueryTests method initMocks.

@Before
public void initMocks() throws NoSuchMethodException {
    this.queryMethod = mock(SpannerQueryMethod.class);
    // this is a dummy object. it is not mockable otherwise.
    Method method = Object.class.getMethod("toString");
    when(this.queryMethod.getMethod()).thenReturn(method);
    this.spannerTemplate = mock(SpannerTemplate.class);
    SpannerEntityProcessor spannerEntityProcessor = mock(SpannerEntityProcessor.class);
    when(this.spannerTemplate.getSpannerEntityProcessor()).thenReturn(spannerEntityProcessor);
    when(spannerEntityProcessor.getWriteConverter()).thenReturn(new SpannerWriteConverter());
    this.spannerMappingContext = new SpannerMappingContext();
}
Also used : SpannerEntityProcessor(org.springframework.cloud.gcp.data.spanner.core.convert.SpannerEntityProcessor) SpannerMappingContext(org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext) SpannerTemplate(org.springframework.cloud.gcp.data.spanner.core.SpannerTemplate) Method(java.lang.reflect.Method) SpannerWriteConverter(org.springframework.cloud.gcp.data.spanner.core.convert.SpannerWriteConverter) Before(org.junit.Before)

Aggregations

Method (java.lang.reflect.Method)1 Before (org.junit.Before)1 SpannerTemplate (org.springframework.cloud.gcp.data.spanner.core.SpannerTemplate)1 SpannerEntityProcessor (org.springframework.cloud.gcp.data.spanner.core.convert.SpannerEntityProcessor)1 SpannerWriteConverter (org.springframework.cloud.gcp.data.spanner.core.convert.SpannerWriteConverter)1 SpannerMappingContext (org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext)1