File tree 2 files changed +37
-35
lines changed
micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct 2 files changed +37
-35
lines changed Original file line number Diff line number Diff line change 18
18
19
19
@ Microserver
20
20
public class AsyncPublisherTest {
21
- RestAgent rest = new RestAgent ();
22
- MicroserverApp server ;
23
- @ Before
24
- public void startServer (){
25
-
26
- server = new MicroserverApp (()->"binder" );
27
- server .start ();
28
-
29
- }
30
-
31
- @ After
32
- public void stopServer (){
33
- server .stop ();
34
- }
35
-
36
- @ Test
37
- public void runAppAndBasicTest () throws InterruptedException , ExecutionException {
38
-
39
-
40
- //DirectMyIncovationHandler.captured=false;
41
- assertThat (rest .get ("http://localhost:8080/binder/test" ),is ("hello world!" ));
42
- //assertTrue(DirectMyIncovationHandler.captured);
43
-
44
-
45
- }
21
+ RestAgent rest = new RestAgent ();
22
+ MicroserverApp server ;
23
+
24
+ @ Before
25
+ public void startServer () {
26
+
27
+ server = new MicroserverApp (() -> "binder" );
28
+ server .start ();
29
+
30
+ }
31
+
32
+ @ After
33
+ public void stopServer () {
34
+ server .stop ();
35
+ }
36
+
37
+ @ Test
38
+ public void runAppAndBasicTest () throws InterruptedException , ExecutionException {
39
+
40
+
41
+ //DirectMyIncovationHandler.captured=false;
42
+ assertThat (rest .get ("http://localhost:8080/binder/test" ), is ("hello world!" ));
43
+ //assertTrue(DirectMyIncovationHandler.captured);
44
+
45
+
46
+ }
46
47
}
Original file line number Diff line number Diff line change 15
15
@ Path ("/test" )
16
16
public class AsyncResource {
17
17
18
- private void sleep (){
18
+ private void sleep () {
19
19
try {
20
20
Thread .sleep (10000 );
21
21
} catch (InterruptedException e ) {
22
22
e .printStackTrace ();
23
23
}
24
24
}
25
25
26
- @ GET
27
- public Future <String > myEndPoint (){
28
- return Future .ofSupplier (()-> {
26
+ @ GET
27
+ public Future <String > myEndPoint () {
28
+ return Future .ofSupplier (() -> {
29
29
sleep ();
30
- return "hello world!" ;
31
- }, Executors .newFixedThreadPool (1 ));
32
- }
30
+ return "hello world!" ;
31
+ }, Executors .newFixedThreadPool (1 ));
32
+ }
33
+
33
34
@ GET
34
- public ReactiveSeq <String > async2 (){
35
- return Spouts .publishOn (Stream .of ("hello" ),Executors .newFixedThreadPool (1 ));
35
+ public ReactiveSeq <String > async2 () {
36
+ return Spouts .publishOn (Stream .of ("hello" ), Executors .newFixedThreadPool (1 ));
36
37
}
37
38
38
-
39
+
39
40
}
You can’t perform that action at this time.
0 commit comments