File tree Expand file tree Collapse file tree 3 files changed +44
-51
lines changed
src/test/java/com/tvd12/ezyfoxserver/client/testing Expand file tree Collapse file tree 3 files changed +44
-51
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ java client for ezyfox server
99<dependency >
1010 <groupId >com.tvd12</groupId >
1111 <artifactId >ezyfox-server-java-client</artifactId >
12- <version >1.1.9 </version >
12+ <version >1.2.0 </version >
1313</dependency >
1414```
1515
Original file line number Diff line number Diff line change 44import com .tvd12 .ezyfoxserver .client .config .EzyPingConfig ;
55import org .testng .annotations .Test ;
66
7+ import java .util .Random ;
8+
79public class EzyClientConfigTest {
810
911 @ Test
@@ -20,4 +22,45 @@ public void propertiesTest() {
2022 // then
2123 assert actualPingConfig != null ;
2224 }
25+
26+ @ Test
27+ public void test () {
28+ // given
29+ String zoneName = "testZone" ;
30+ String clientName = "testClient" ;
31+ int maxReconnectCount = new Random ().nextInt ();
32+ int reconnectPeriod = new Random ().nextInt ();
33+
34+ EzyClientConfig config = EzyClientConfig .builder ()
35+ .zoneName (zoneName )
36+ .clientName (clientName )
37+ .reconnectConfigBuilder ()
38+ .enable (true )
39+ .maxReconnectCount (maxReconnectCount )
40+ .reconnectPeriod (reconnectPeriod )
41+ .done ()
42+ .build ();
43+
44+ // when
45+ // then
46+ assert config .getClientName ().equals (clientName );
47+ assert config .getZoneName ().equals (zoneName );
48+ assert config .getReconnect ().isEnable ();
49+ assert config .getReconnect ().getMaxReconnectCount () == maxReconnectCount ;
50+ assert config .getReconnect ().getReconnectPeriod () == reconnectPeriod ;
51+ }
52+
53+ @ Test
54+ public void testClientNameNull () {
55+ // given
56+ String zoneName = "testZone" ;
57+
58+ EzyClientConfig config = EzyClientConfig .builder ()
59+ .zoneName (zoneName )
60+ .build ();
61+
62+ // when
63+ // then
64+ assert config .getClientName ().equals (zoneName );
65+ }
2366}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments