@@ -72,4 +72,79 @@ void ensureRoundTripWorks() throws URISyntaxException {
7272
7373 assertThat (seen ).isEqualTo (status );
7474 }
75+
76+ @ Test
77+ void withoutSessionTimeoutInJsonStatus () throws URISyntaxException {
78+ String source =
79+ "{\n "
80+ + " \" availability\" : \" UP\" ,\n "
81+ + " \" externalUri\" : \" http:\\ u002f\\ u002f192.168.1.101:5555\" ,\n "
82+ + " \" heartbeatPeriod\" : 60000,\n "
83+ + " \" maxSessions\" : 1,\n "
84+ + " \" nodeId\" : \" d136dd9b-6497-4049-9371-42f89b14ea2b\" ,\n "
85+ + " \" osInfo\" : {\n "
86+ + " \" arch\" : \" aarch64\" ,\n "
87+ + " \" name\" : \" Mac OS X\" ,\n "
88+ + " \" version\" : \" 15.3\" \n "
89+ + " },\n "
90+ + " \" slots\" : [\n "
91+ + " {\n "
92+ + " \" id\" : {\n "
93+ + " \" hostId\" : \" d136dd9b-6497-4049-9371-42f89b14ea2b\" ,\n "
94+ + " \" id\" : \" 965e8cb4-7b48-4638-8bc8-6889c6319682\" \n "
95+ + " },\n "
96+ + " \" lastStarted\" : \" 1970-01-01T00:00:00Z\" ,\n "
97+ + " \" session\" : null,\n "
98+ + " \" stereotype\" : {\n "
99+ + " \" browserName\" : \" chrome\" ,\n "
100+ + " \" platformName\" : \" mac\" \n "
101+ + " }\n "
102+ + " }\n "
103+ + " ],\n "
104+ + " \" version\" : \" 4.17.0 (revision unknown*)\" \n "
105+ + " }" ;
106+
107+ Json json = new Json ();
108+ NodeStatus nodeStatus = json .toType (source , NodeStatus .class );
109+
110+ assertThat (nodeStatus .getSessionTimeout ()).isEqualTo (Duration .ofSeconds (300 ));
111+ }
112+
113+ @ Test
114+ void withSessionTimeoutInJsonStatus () throws URISyntaxException {
115+ String source =
116+ "{\n "
117+ + " \" availability\" : \" UP\" ,\n "
118+ + " \" externalUri\" : \" http:\\ u002f\\ u002f192.168.1.101:5555\" ,\n "
119+ + " \" heartbeatPeriod\" : 60000,\n "
120+ + " \" maxSessions\" : 1,\n "
121+ + " \" sessionTimeout\" : 600000,\n "
122+ + " \" nodeId\" : \" d136dd9b-6497-4049-9371-42f89b14ea2b\" ,\n "
123+ + " \" osInfo\" : {\n "
124+ + " \" arch\" : \" aarch64\" ,\n "
125+ + " \" name\" : \" Mac OS X\" ,\n "
126+ + " \" version\" : \" 15.3\" \n "
127+ + " },\n "
128+ + " \" slots\" : [\n "
129+ + " {\n "
130+ + " \" id\" : {\n "
131+ + " \" hostId\" : \" d136dd9b-6497-4049-9371-42f89b14ea2b\" ,\n "
132+ + " \" id\" : \" 965e8cb4-7b48-4638-8bc8-6889c6319682\" \n "
133+ + " },\n "
134+ + " \" lastStarted\" : \" 1970-01-01T00:00:00Z\" ,\n "
135+ + " \" session\" : null,\n "
136+ + " \" stereotype\" : {\n "
137+ + " \" browserName\" : \" chrome\" ,\n "
138+ + " \" platformName\" : \" mac\" \n "
139+ + " }\n "
140+ + " }\n "
141+ + " ],\n "
142+ + " \" version\" : \" 4.17.0 (revision unknown*)\" \n "
143+ + " }" ;
144+
145+ Json json = new Json ();
146+ NodeStatus nodeStatus = json .toType (source , NodeStatus .class );
147+
148+ assertThat (nodeStatus .getSessionTimeout ()).isEqualTo (Duration .ofSeconds (600 ));
149+ }
75150}
0 commit comments