29
29
30
30
import static org .apache .dubbo .common .constants .QosConstants .ACCEPT_FOREIGN_IP ;
31
31
import static org .apache .dubbo .common .constants .QosConstants .QOS_ENABLE ;
32
+ import static org .apache .dubbo .common .constants .QosConstants .QOS_HOST ;
32
33
import static org .apache .dubbo .common .constants .QosConstants .QOS_PORT ;
33
34
import static org .apache .dubbo .common .constants .RegistryConstants .REGISTRY_PROTOCOL ;
34
35
import static org .hamcrest .MatcherAssert .assertThat ;
@@ -47,6 +48,7 @@ public class QosProtocolWrapperTest {
47
48
@ BeforeEach
48
49
public void setUp () throws Exception {
49
50
when (url .getParameter (QOS_ENABLE , true )).thenReturn (true );
51
+ when (url .getParameter (QOS_HOST )).thenReturn ("localhost" );
50
52
when (url .getParameter (QOS_PORT , 22222 )).thenReturn (12345 );
51
53
when (url .getParameter (ACCEPT_FOREIGN_IP , true )).thenReturn (false );
52
54
when (invoker .getUrl ()).thenReturn (url );
@@ -64,6 +66,7 @@ public void tearDown() throws Exception {
64
66
public void testExport () throws Exception {
65
67
wrapper .export (invoker );
66
68
assertThat (server .isStarted (), is (true ));
69
+ assertThat (server .getHost (), is ("localhost" ));
67
70
assertThat (server .getPort (), is (12345 ));
68
71
assertThat (server .isAcceptForeignIp (), is (false ));
69
72
verify (protocol ).export (invoker );
@@ -73,6 +76,7 @@ public void testExport() throws Exception {
73
76
public void testRefer () throws Exception {
74
77
wrapper .refer (BaseCommand .class , url );
75
78
assertThat (server .isStarted (), is (true ));
79
+ assertThat (server .getHost (), is ("localhost" ));
76
80
assertThat (server .getPort (), is (12345 ));
77
81
assertThat (server .isAcceptForeignIp (), is (false ));
78
82
verify (protocol ).refer (BaseCommand .class , url );
0 commit comments