use of org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext in project spring-cloud-gcp by spring-cloud.
the class SpannerTemplateTests method setUp.
@Before
public void setUp() {
this.databaseClient = mock(DatabaseClient.class);
this.mappingContext = new SpannerMappingContext();
this.objectMapper = mock(SpannerConverter.class);
this.mutationFactory = mock(SpannerMutationFactory.class);
this.readContext = mock(ReadContext.class);
when(this.databaseClient.singleUse()).thenReturn(this.readContext);
this.spannerTemplate = new SpannerTemplate(this.databaseClient, this.mappingContext, this.objectMapper, this.mutationFactory);
}
use of org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext in project spring-cloud-gcp by spring-cloud.
the class SpannerMutationFactoryImplTests method setUp.
@Before
public void setUp() {
this.mappingContext = new SpannerMappingContext();
this.objectMapper = mock(SpannerConverter.class);
this.spannerMutationFactory = new SpannerMutationFactoryImpl(this.objectMapper, this.mappingContext);
}
use of org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext in project spring-cloud-gcp by spring-cloud.
the class SpannerQueryLookupStrategyTests method initMocks.
@Before
public void initMocks() {
this.spannerOperations = mock(SpannerOperations.class);
this.spannerMappingContext = new SpannerMappingContext();
this.queryMethod = mock(QueryMethod.class);
this.spannerQueryLookupStrategy = getSpannerQueryLookupStrategy();
}
use of org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext in project spring-cloud-gcp by spring-cloud.
the class SpannerStatementQueryTests method initMocks.
@Before
public void initMocks() {
this.queryMethod = mock(QueryMethod.class);
this.spannerOperations = mock(SpannerOperations.class);
this.spannerMappingContext = new SpannerMappingContext();
}
use of org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext in project spring-cloud-gcp by spring-cloud.
the class SpannerRepositoryFactoryBeanTests method setUp.
@Before
public void setUp() {
this.spannerMappingContext = new SpannerMappingContext();
this.spannerOperations = mock(SpannerOperations.class);
this.spannerRepositoryFactoryBean = new SpannerRepositoryFactoryBean(SpannerRepository.class);
this.spannerRepositoryFactoryBean.setSpannerMappingContext(this.spannerMappingContext);
this.spannerRepositoryFactoryBean.setSpannerOperations(this.spannerOperations);
}
Aggregations