We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firestore client library can only connect to a firestore emulator by using an env var. This is not idiomatic for Java unit tests.
it's impossible to set the emulator host/port simply from .setHost(..)
.setHost(..)
FirestoreOptions firestoreOptions = FirestoreOptions.newBuilder().setHost(...).
The real code is this:
// duplicate the FakeCredentials class because it's package protected and not publicly accessible. static class FakeCredentials extends Credentials { private final Map<String, List<String>> HEADERS = ImmutableMap.of("Authorization", Arrays.asList("Bearer owner")); ... } // then, duplicate the code that otherwise executes from an env var: FirestoreOptions firestoreOptions = FirestoreOptions.newBuilder() .setProjectId(FIRESTORE_PROJECT_ID) .setChannelProvider( InstantiatingGrpcChannelProvider.newBuilder() .setEndpoint( String.format( "%s:%d", FIRESTORE_CONTAINER.getContainerIpAddress(), FIRESTORE_CONTAINER.getMappedPort(8080))) .setChannelConfigurator( (managedChannelBuilder -> managedChannelBuilder.usePlaintext())) .build()) .setCredentialsProvider(FixedCredentialsProvider.create(new FakeCredentials())) .build();
It'd be MUCH easier if emulator host/port can simply be set via .setHost(...), OR, a convenience method, such as .useEmulator(host, port)
The text was updated successfully, but these errors were encountered:
/cc @eddumelendez who's also working with TestContainer integration for GCP. https://github.com/eddumelendez/testcontainers-java/tree/gcloud
Sorry, something went wrong.
hmm, i think this is the wrong repo after filing the issue. moving to googleapis/java-firestore#210
saturnism
No branches or pull requests
Environment details
Steps to reproduce
Code example
Firestore client library can only connect to a firestore emulator by using an env var. This is not idiomatic for Java unit tests.
it's impossible to set the emulator host/port simply from
.setHost(..)
The real code is this:
Any additional information below
It'd be MUCH easier if emulator host/port can simply be set via .setHost(...), OR, a convenience method, such as .useEmulator(host, port)
The text was updated successfully, but these errors were encountered: