Skip to content

Commit

Permalink
Fix assertions which are no longer true after this commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jacobs committed Aug 2, 2016
1 parent 749e3db commit bde8615
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hystrix-core/src/test/java/com/netflix/hystrix/HystrixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

import static org.junit.Assert.*;
Expand Down Expand Up @@ -94,28 +95,29 @@ protected Boolean run() {
command.observe().subscribe(new Subscriber<Boolean>() {
@Override
public void onCompleted() {
System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " OnCompleted");
latch.countDown();
}

@Override
public void onError(Throwable e) {
System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " OnError : " + e);
e.printStackTrace();
fail(e.getMessage());
latch.countDown();
}

@Override
public void onNext(Boolean value) {
System.out.println("OnNext : " + value);
System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " OnNext : " + value);
assertTrue(value);
assertEquals("CommandName", Hystrix.getCurrentThreadExecutingCommand().name());
assertEquals(1, Hystrix.getCommandCount());
}
});

try {
assertNull(Hystrix.getCurrentThreadExecutingCommand());
assertEquals(0, Hystrix.getCommandCount());
latch.await();
assertTrue(latch.await(1000, TimeUnit.MILLISECONDS));
} catch (InterruptedException ex) {
fail(ex.getMessage());
}
Expand Down

0 comments on commit bde8615

Please sign in to comment.