@@ -120,6 +120,93 @@ void authorizationSession() throws IOException, InterruptedException {
120120 .isEqualTo ("session=yCgXaEBF8mYSmJUweRcW0g_5jElMs7mv6_-G1bNcau4Z0ZLQYtj0BkHZYRnBVA6uXHtyuhflcOzyNDNRxnaC0A==" );
121121 }
122122
123+ @ Test
124+ public void buildPath () {
125+
126+ InfluxDBClientOptions options = InfluxDBClientOptions .builder ()
127+ .url ("http://localhost:8086" )
128+ .authenticate ("user" , "secret" .toCharArray ())
129+ .build ();
130+
131+ Assertions
132+ .assertThat ("http://localhost:8086/api/v2/signin" )
133+ .isEqualTo (new AuthenticateInterceptor (options ).buildPath ("api/v2/signin" ));
134+
135+ options = InfluxDBClientOptions .builder ()
136+ .url ("http://localhost:8086/" )
137+ .authenticate ("user" , "secret" .toCharArray ())
138+ .build ();
139+
140+ Assertions
141+ .assertThat ("http://localhost:8086/api/v2/signin" )
142+ .isEqualTo (new AuthenticateInterceptor (options ).buildPath ("api/v2/signin" ));
143+
144+ options = InfluxDBClientOptions .builder ()
145+ .url ("http://localhost:8086/proxy" )
146+ .authenticate ("user" , "secret" .toCharArray ())
147+ .build ();
148+
149+ Assertions
150+ .assertThat ("http://localhost:8086/proxy/api/v2/signin" )
151+ .isEqualTo (new AuthenticateInterceptor (options ).buildPath ("api/v2/signin" ));
152+
153+ options = InfluxDBClientOptions .builder ()
154+ .url ("http://localhost:8086/proxy/" )
155+ .authenticate ("user" , "secret" .toCharArray ())
156+ .build ();
157+
158+ Assertions
159+ .assertThat ("http://localhost:8086/proxy/api/v2/signin" )
160+ .isEqualTo (new AuthenticateInterceptor (options ).buildPath ("api/v2/signin" ));
161+ }
162+
163+ @ Test
164+ void connectionStringSigInSignOutURL () {
165+
166+ InfluxDBClientOptions options = InfluxDBClientOptions .builder ()
167+ .connectionString ("http://localhost:8086?writeTimeout=1000&connectTimeout=1000&logLevel=BODY" )
168+ .authenticate ("user" , "secret" .toCharArray ())
169+ .build ();
170+
171+ AuthenticateInterceptor interceptor = new AuthenticateInterceptor (options );
172+
173+ Assertions
174+ .assertThat ("http://localhost:8086/api/v2/signin" )
175+ .isEqualTo (interceptor .buildPath ("api/v2/signin" ));
176+
177+ Assertions
178+ .assertThat ("http://localhost:8086/api/v2/signout" )
179+ .isEqualTo (interceptor .buildPath ("api/v2/signout" ));
180+
181+ Assertions
182+ .assertThat ("http://localhost:8086/api/v2/setup" )
183+ .isEqualTo (interceptor .buildPath ("api/v2/setup" ));
184+ }
185+
186+
187+ @ Test
188+ void connectionStringSigInSignOutURLProxy () {
189+
190+ InfluxDBClientOptions options = InfluxDBClientOptions .builder ()
191+ .connectionString ("http://localhost:8086/proxy?writeTimeout=1000&connectTimeout=1000&logLevel=BODY" )
192+ .authenticate ("user" , "secret" .toCharArray ())
193+ .build ();
194+
195+ AuthenticateInterceptor interceptor = new AuthenticateInterceptor (options );
196+
197+ Assertions
198+ .assertThat ("http://localhost:8086/proxy/api/v2/signin" )
199+ .isEqualTo (interceptor .buildPath ("api/v2/signin" ));
200+
201+ Assertions
202+ .assertThat ("http://localhost:8086/proxy/api/v2/signout" )
203+ .isEqualTo (interceptor .buildPath ("api/v2/signout" ));
204+
205+ Assertions
206+ .assertThat ("http://localhost:8086/proxy/api/v2/setup" )
207+ .isEqualTo (interceptor .buildPath ("api/v2/setup" ));
208+ }
209+
123210 @ Test
124211 void authorizationSessionWithoutCookie () throws IOException , InterruptedException {
125212
0 commit comments