Skip to content

fix: remove call credentials from call options if DirectPath #3670

New issue

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

Merged
merged 13 commits into from
Mar 10, 2025
Prev Previous commit
Next Next commit
fix typo and slightly more coverage
  • Loading branch information
rockspore committed Mar 3, 2025
commit 11ce53e933f27aacc2fb0ef9a705bf6bdab7c0ad
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void testWithTransportChannelWrongType() {
}

@Test
void testWithTransportChannelIsDirectcPath() {
void testWithTransportChannelIsDirectPath() {
ManagedChannel channel = Mockito.mock(ManagedChannel.class);
Credentials credentials = Mockito.mock(GoogleCredentials.class);
GrpcCallContext context = GrpcCallContext.createDefault().withCredentials(credentials);
Expand All @@ -114,6 +114,10 @@ void testWithTransportChannelIsDirectcPath() {
.setManagedChannel(channel)
.build());
assertNull(context.getCallOptions().getCredentials());

// This should revert isDirectPath to false.
context = context.withChannel(channel);
assertNotNull(context.getCallOptions().getCredentials());
}

@Test
Expand Down
Loading