File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import static com .google .common .base .Preconditions .checkNotNull ;
2121import static com .google .common .base .Strings .isNullOrEmpty ;
2222
23+ import com .google .common .annotations .VisibleForTesting ;
2324import com .google .errorprone .annotations .CanIgnoreReturnValue ;
2425import io .grpc .Channel ;
2526import io .grpc .ChannelCredentials ;
@@ -110,7 +111,8 @@ public Builder setLocalUid(String localUid) {
110111 * Sets the stub to use to communicate with S2A. This is only used for testing that the
111112 * stream to S2A gets closed.
112113 */
113- public Builder setStub (S2AStub stub ) {
114+ @ VisibleForTesting
115+ Builder setStub (S2AStub stub ) {
114116 checkNotNull (stub );
115117 this .stub = stub ;
116118 return this ;
@@ -130,4 +132,4 @@ InternalProtocolNegotiator.ClientFactory buildProtocolNegotiatorFactory() {
130132 }
131133
132134 private S2AChannelCredentials () {}
133- }
135+ }
Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ public class S2AStub implements AutoCloseable {
4444 private boolean doneWriting = false ;
4545 private boolean isClosed = false ;
4646
47- static S2AStub newInstance (S2AServiceGrpc .S2AServiceStub serviceStub ) {
47+ @ VisibleForTesting
48+ public static S2AStub newInstance (S2AServiceGrpc .S2AServiceStub serviceStub ) {
4849 checkNotNull (serviceStub );
4950 return new S2AStub (serviceStub );
5051 }
@@ -224,4 +225,4 @@ SessionResp getResultOrThrow() throws IOException {
224225 return response .get ();
225226 }
226227 }
227- }
228+ }
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17- package io .grpc .s2a . internal . handshaker ;
17+ package io .grpc .s2a ;
1818
1919import static com .google .common .truth .Truth .assertThat ;
2020import static java .util .concurrent .TimeUnit .SECONDS ;
3737import io .grpc .s2a .S2AChannelCredentials ;
3838import io .grpc .s2a .internal .channel .S2AHandshakerServiceChannel ;
3939import io .grpc .s2a .internal .handshaker .FakeS2AServer ;
40+ import io .grpc .s2a .internal .handshaker .S2AServiceGrpc ;
41+ import io .grpc .s2a .internal .handshaker .S2AStub ;
4042import io .grpc .stub .StreamObserver ;
4143import io .grpc .testing .protobuf .SimpleRequest ;
4244import io .grpc .testing .protobuf .SimpleResponse ;
You can’t perform that action at this time.
0 commit comments