Skip to content

Commit 4718218

Browse files
committed
binder: Fix failing BinderSecurityTest test case
9ffa1e1 normalized server SecurityPolicy failures to emit code INTERNAL with a uniform "Authorization future failed" message but neglected to update a BinderSecurityTest case that asserts the opposite.
1 parent 6b2d978 commit 4718218

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

binder/src/androidTest/java/io/grpc/binder/BinderSecurityTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,25 +179,24 @@ public void testServerDisallowsCalls() throws Exception {
179179
}
180180

181181
@Test
182-
public void testFailedFuturesPropagateOriginalException() throws Exception {
183-
String errorMessage = "something went wrong";
184-
IllegalStateException originalException = new IllegalStateException(errorMessage);
182+
public void testFailedFuturesFailWithCodeInternal() throws Exception {
185183
createChannel(
186184
ServerSecurityPolicy.newBuilder()
187185
.servicePolicy(
188186
"foo",
189187
new AsyncSecurityPolicy() {
190188
@Override
191189
public ListenableFuture<Status> checkAuthorizationAsync(int uid) {
192-
return Futures.immediateFailedFuture(originalException);
190+
return Futures.immediateFailedFuture(
191+
new IllegalStateException("internal to SecurityPolicy"));
193192
}
194193
})
195194
.build(),
196195
SecurityPolicies.internalOnly());
197196
MethodDescriptor<Empty, Empty> method = methods.get("foo/method0");
198197

199198
StatusRuntimeException sre = assertCallFailure(method, Status.INTERNAL);
200-
assertThat(sre.getStatus().getDescription()).contains(errorMessage);
199+
assertThat(sre.getStatus().getDescription()).isEqualTo("Authorization future failed");
201200
}
202201

203202
@Test

0 commit comments

Comments
 (0)