1
1
package com .guicedee .examples .jaxrs .binding .test ;
2
2
3
+ import com .guicedee .client .IGuiceContext ;
3
4
import com .guicedee .examples .jaxrs .binding .BootJaxRSBindings ;
4
- import com .guicedee .guicedinjection .GuiceContext ;
5
- import com .guicedee .guicedservlets .undertow .GuicedUndertow ;
6
- import io .undertow .Undertow ;
7
5
import org .junit .jupiter .api .Test ;
8
6
9
7
import java .net .URI ;
13
11
import java .time .Duration ;
14
12
import java .time .temporal .ChronoUnit ;
15
13
16
- import static org .junit .jupiter .api .Assertions .* ;
14
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
17
15
18
16
class BootJaxRSBindingsTest
19
17
{
20
18
21
- @ Test
22
- public void testRS () throws Exception
23
- {
24
- BootJaxRSBindings .main (null );
25
-
26
- HttpClient client = HttpClient .newBuilder ()
27
- .connectTimeout (Duration .of (5 , ChronoUnit .SECONDS ))
28
- .build ();
29
- HttpResponse response = client .send (HttpRequest .newBuilder ()
30
- .GET ()
31
- .uri (new URI ("http://localhost:6003/rest/hello/world" ))
32
- .build (),
33
- HttpResponse .BodyHandlers .ofString ());
34
- System .out .println (response .body ());
35
- assertEquals (200 , response .statusCode ());
36
- response = client .send (HttpRequest .newBuilder ()
37
- .GET ()
38
- .uri (new URI ("http://localhost:6003/rest/hello/helloObject/world" ))
39
- .build (),
40
- HttpResponse .BodyHandlers .ofString ());
41
- System .out .println (response .body ());
42
-
43
- assertEquals (200 , response .statusCode ());
44
-
45
- GuiceContext .destroy ();
46
- }
19
+ @ Test
20
+ public void testRS () throws Exception
21
+ {
22
+ BootJaxRSBindings .main (null );
23
+
24
+ HttpClient client = HttpClient .newBuilder ()
25
+ .connectTimeout (Duration .of (5 , ChronoUnit .SECONDS ))
26
+ .build ();
27
+ HttpResponse response = client .send (HttpRequest .newBuilder ()
28
+ .GET ()
29
+ .uri (new URI ("http://localhost:6003/rest/hello/world" ))
30
+ .build (),
31
+ HttpResponse .BodyHandlers .ofString ());
32
+ System .out .println (response .body ());
33
+ assertEquals (200 , response .statusCode ());
34
+ response = client .send (HttpRequest .newBuilder ()
35
+ .GET ()
36
+ .uri (new URI ("http://localhost:6003/rest/hello/helloObject/world" ))
37
+ .build (),
38
+ HttpResponse .BodyHandlers .ofString ());
39
+ System .out .println (response .body ());
40
+
41
+ assertEquals (200 , response .statusCode ());
42
+
43
+ IGuiceContext .instance ()
44
+ .destroy ();
45
+ }
47
46
}
0 commit comments