File tree Expand file tree Collapse file tree
spring-grpc-core/src/test/java/org/springframework/grpc/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023-present the original author or authors.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package org .springframework .grpc .client ;
18+
19+ import static org .assertj .core .api .Assertions .assertThat ;
20+ import static org .mockito .Mockito .mock ;
21+
22+ import java .util .List ;
23+
24+ import org .junit .jupiter .api .Test ;
25+
26+ /**
27+ * Tests for {@link DefaultGrpcChannelFactory}.
28+ *
29+ * @author Andrey Litvitski
30+ */
31+ class DefaultGrpcChannelFactoryTests {
32+
33+ @ Test
34+ void defaultTargetResolvesToLocalhost () {
35+ var factory = new DefaultGrpcChannelFactory <>(List .of (), mock ());
36+ assertThat (factory .targets ).isSameAs (VirtualTargets .DEFAULT );
37+ assertThat (factory .targets .getTarget ("default" )).isEqualTo ("localhost:9090" );
38+ }
39+
40+ }
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ void defaultSupportsEverythingExceptInProcess() {
208208 assertThat (channelFactory .supports ("static:127.0.0.1" )).isTrue ();
209209 assertThat (channelFactory .supports ("in-process:foo" )).isFalse ();
210210 assertThat (channelFactory .supports ("default" )).isFalse ();
211- }
211+ }
212212
213213 @ Test
214214 void nettySupportsEverythingExceptInProcess () {
You can’t perform that action at this time.
0 commit comments