use of com.google.api.gax.grpc.InstantiatingGrpcChannelProvider in project spring-cloud-gcp by spring-cloud.
the class GcpFirestoreEmulatorAutoConfigurationTests method testAutoConfigurationDisabled.
@Test
public void testAutoConfigurationDisabled() {
contextRunner.run(context -> {
FirestoreOptions firestoreOptions = context.getBean(FirestoreOptions.class);
String endpoint = ((InstantiatingGrpcChannelProvider) firestoreOptions.getTransportChannelProvider()).getEndpoint();
assertThat(endpoint).isEqualTo("firestore.googleapis.com:443");
FirestoreTemplate firestoreTemplate = context.getBean(FirestoreTemplate.class);
assertThat(firestoreTemplate.isUsingStreamTokens()).isTrue();
});
}
use of com.google.api.gax.grpc.InstantiatingGrpcChannelProvider in project spring-cloud-gcp by spring-cloud.
the class GcpFirestoreEmulatorAutoConfigurationTests method testAutoConfigurationEnabled.
@Test
public void testAutoConfigurationEnabled() {
contextRunner.withPropertyValues("spring.cloud.gcp.firestore.emulator.enabled=true", "spring.cloud.gcp.firestore.host-port=localhost:9000").run(context -> {
FirestoreOptions firestoreOptions = context.getBean(FirestoreOptions.class);
String endpoint = ((InstantiatingGrpcChannelProvider) firestoreOptions.getTransportChannelProvider()).getEndpoint();
assertThat(endpoint).isEqualTo("localhost:9000");
FirestoreTemplate firestoreTemplate = context.getBean(FirestoreTemplate.class);
assertThat(firestoreTemplate.isUsingStreamTokens()).isFalse();
assertThat(firestoreOptions.getProjectId()).isEqualTo("unused");
});
}
Aggregations