Skip to content

Commit

Permalink
Rename tests to avoid ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-costigliola committed Mar 18, 2018
1 parent 07e6622 commit 1685e00
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -26,37 +26,37 @@
public class CompletableFutureAssert_hasFailed_Test extends BaseTest {

@Test
public void should_pass_if_completable_future_has_failed() {
public void assertion_should_pass_if_completable_future_has_failed() {
CompletableFuture<String> future = new CompletableFuture<>();
future.completeExceptionally(new RuntimeException());

assertThat(future).hasFailed();
}

@Test
public void should_fail_when_completable_future_is_null() {
public void assertion_should_fail_when_completable_future_is_null() {
assertThatThrownBy(() -> assertThat((CompletableFuture<String>) null).hasFailed()).isInstanceOf(AssertionError.class)
.hasMessage(format(actualIsNull()));
}

@Test
public void should_fail_if_completable_future_is_incomplete() {
public void assertion_should_fail_if_completable_future_is_incomplete() {
CompletableFuture<String> future = new CompletableFuture<>();

assertThatThrownBy(() -> assertThat(future).hasFailed()).isInstanceOf(AssertionError.class)
.hasMessage(shouldHaveFailed(future).create());
}

@Test
public void should_fail_if_completable_future_is_completed() {
public void assertion_should_fail_if_completable_future_is_completed() {
CompletableFuture<String> future = CompletableFuture.completedFuture("done");

assertThatThrownBy(() -> assertThat(future).hasFailed()).isInstanceOf(AssertionError.class)
.hasMessage(shouldHaveFailed(future).create());
}

@Test
public void should_fail_if_completable_future_was_cancelled() {
public void assertion_should_fail_if_completable_future_was_cancelled() {
CompletableFuture<String> future = new CompletableFuture<>();
future.cancel(true);

Expand Down

0 comments on commit 1685e00

Please sign in to comment.