Search in sources :

Example 1 with TwoStepsConversions

use of org.springframework.cloud.gcp.data.datastore.core.convert.TwoStepsConversions in project spring-cloud-gcp by spring-cloud.

the class GqlDatastoreQueryTests method initMocks.

@Before
public void initMocks() {
    this.queryMethod = mock(DatastoreQueryMethod.class);
    this.datastoreTemplate = mock(DatastoreTemplate.class);
    this.datastoreEntityConverter = mock(DatastoreEntityConverter.class);
    this.readWriteConversions = new TwoStepsConversions(new DatastoreCustomConversions(), null, this.datastoreMappingContext);
    when(this.datastoreTemplate.getDatastoreEntityConverter()).thenReturn(this.datastoreEntityConverter);
    when(this.datastoreEntityConverter.getConversions()).thenReturn(this.readWriteConversions);
    this.evaluationContextProvider = mock(QueryMethodEvaluationContextProvider.class);
}
Also used : TwoStepsConversions(org.springframework.cloud.gcp.data.datastore.core.convert.TwoStepsConversions) DatastoreTemplate(org.springframework.cloud.gcp.data.datastore.core.DatastoreTemplate) QueryMethodEvaluationContextProvider(org.springframework.data.repository.query.QueryMethodEvaluationContextProvider) DatastoreCustomConversions(org.springframework.cloud.gcp.data.datastore.core.convert.DatastoreCustomConversions) DatastoreEntityConverter(org.springframework.cloud.gcp.data.datastore.core.convert.DatastoreEntityConverter) Before(org.junit.Before)

Example 2 with TwoStepsConversions

use of org.springframework.cloud.gcp.data.datastore.core.convert.TwoStepsConversions in project spring-cloud-gcp by spring-cloud.

the class PartTreeDatastoreQueryTests method initMocks.

@Before
public void initMocks() {
    this.queryMethod = mock(DatastoreQueryMethod.class);
    when(this.queryMethod.getReturnedObjectType()).thenReturn((Class) TestEntity.class);
    this.datastoreTemplate = mock(DatastoreTemplate.class);
    this.datastoreMappingContext = new DatastoreMappingContext();
    this.datastoreEntityConverter = mock(DatastoreEntityConverter.class);
    this.readWriteConversions = new TwoStepsConversions(new DatastoreCustomConversions(), null, this.datastoreMappingContext);
    when(this.datastoreTemplate.getDatastoreEntityConverter()).thenReturn(this.datastoreEntityConverter);
    when(this.datastoreEntityConverter.getConversions()).thenReturn(this.readWriteConversions);
}
Also used : TestEntity(org.springframework.cloud.gcp.data.datastore.it.TestEntity) TwoStepsConversions(org.springframework.cloud.gcp.data.datastore.core.convert.TwoStepsConversions) DatastoreMappingContext(org.springframework.cloud.gcp.data.datastore.core.mapping.DatastoreMappingContext) DatastoreTemplate(org.springframework.cloud.gcp.data.datastore.core.DatastoreTemplate) DatastoreCustomConversions(org.springframework.cloud.gcp.data.datastore.core.convert.DatastoreCustomConversions) DatastoreEntityConverter(org.springframework.cloud.gcp.data.datastore.core.convert.DatastoreEntityConverter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 DatastoreTemplate (org.springframework.cloud.gcp.data.datastore.core.DatastoreTemplate)2 DatastoreCustomConversions (org.springframework.cloud.gcp.data.datastore.core.convert.DatastoreCustomConversions)2 DatastoreEntityConverter (org.springframework.cloud.gcp.data.datastore.core.convert.DatastoreEntityConverter)2 TwoStepsConversions (org.springframework.cloud.gcp.data.datastore.core.convert.TwoStepsConversions)2 DatastoreMappingContext (org.springframework.cloud.gcp.data.datastore.core.mapping.DatastoreMappingContext)1 TestEntity (org.springframework.cloud.gcp.data.datastore.it.TestEntity)1 QueryMethodEvaluationContextProvider (org.springframework.data.repository.query.QueryMethodEvaluationContextProvider)1