CallOptions { public CallOptions withDeadlineAfter(long duration, TimeUnit unit) { return withDeadline(Deadline.after(duration, unit)); } private  CallOptions(); private  CallOptions(CallOptions other); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") CallOptions withAuthority(@Nullable String authority); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") CallOptions withCompression(@Nullable String compressorName); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1706") CallOptions withDeadline(@Nullable Deadline deadline); @Deprecated CallOptions withDeadlineNanoTime(@Nullable Long deadlineNanoTime); CallOptions withDeadlineAfter(long duration, TimeUnit unit); @Deprecated Long getDeadlineNanoTime(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1706") @Nullable Deadline getDeadline(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1766") CallOptions withAffinity(Attributes affinity); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1766") Attributes getAffinity(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") @Nullable String getCompressor(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") String getAuthority(); CallOptions withExecutor(Executor executor); @Nullable Executor getExecutor(); @Override String toString(); static final CallOptions DEFAULT; }
@Test public void withDeadlineAfter() { Deadline actual = CallOptions.DEFAULT.withDeadlineAfter(1, MINUTES).getDeadline(); Deadline expected = Deadline.after(1, MINUTES); assertAbout(deadline()).that(actual).isWithin(10, MILLISECONDS).of(expected); }