File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
hystrix-core/src/test/java/com/netflix/hystrix Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 2727import java .util .ArrayList ;
2828import java .util .List ;
2929import java .util .concurrent .CountDownLatch ;
30- import java .util .concurrent .TimeUnit ;
3130import java .util .concurrent .atomic .AtomicBoolean ;
3231
3332import static org .junit .Assert .*;
@@ -95,29 +94,28 @@ protected Boolean run() {
9594 command .observe ().subscribe (new Subscriber <Boolean >() {
9695 @ Override
9796 public void onCompleted () {
98- System .out .println (System .currentTimeMillis () + " : " + Thread .currentThread ().getName () + " OnCompleted" );
9997 latch .countDown ();
10098 }
10199
102100 @ Override
103101 public void onError (Throwable e ) {
104- System .out .println (System .currentTimeMillis () + " : " + Thread .currentThread ().getName () + " OnError : " + e );
105- e .printStackTrace ();
106102 fail (e .getMessage ());
107103 latch .countDown ();
108104 }
109105
110106 @ Override
111107 public void onNext (Boolean value ) {
112- System .out .println (System . currentTimeMillis () + " : " + Thread . currentThread (). getName () + " OnNext : " + value );
108+ System .out .println (" OnNext : " + value );
113109 assertTrue (value );
110+ assertEquals ("CommandName" , Hystrix .getCurrentThreadExecutingCommand ().name ());
111+ assertEquals (1 , Hystrix .getCommandCount ());
114112 }
115113 });
116114
117115 try {
118116 assertNull (Hystrix .getCurrentThreadExecutingCommand ());
119117 assertEquals (0 , Hystrix .getCommandCount ());
120- assertTrue ( latch .await (1000 , TimeUnit . MILLISECONDS ) );
118+ latch .await ();
121119 } catch (InterruptedException ex ) {
122120 fail (ex .getMessage ());
123121 }
You can’t perform that action at this time.
0 commit comments