use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldNotBeCancelled_create_Test method should_create_error_message.
@Test
public void should_create_error_message() throws Exception {
CompletableFuture<Object> future = new CompletableFuture<>();
future.cancel(true);
String error = shouldNotBeCancelled(future).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting%n" + " <CompletableFuture[Cancelled]>%n" + "not to be cancelled.%n%s", WARNING));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldNotBeCompleted_create_Test method should_create_error_message.
@Test
public void should_create_error_message() throws Exception {
String error = shouldNotBeCompleted(new CompletableFuture<>()).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting%n" + " <CompletableFuture[Incomplete]>%n" + "not to be completed.%n%s", WARNING));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldNotHaveCompletedExceptionally_create_Test method should_create_error_message.
@Test
public void should_create_error_message() throws Exception {
String error = shouldNotHaveCompletedExceptionally(new CompletableFuture<>()).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting%n" + " <CompletableFuture[Incomplete]>%n" + "to not be completed exceptionally.%n%s", WARNING));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldBeAbsolutePath_create_Test method setUp.
@Before
public void setUp() {
description = new TestDescription("Test");
representation = new StandardRepresentation();
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class BasicErrorMessageFactory_create_Test method should_implement_toString.
@Test
public void should_implement_toString() {
Description description = new TestDescription("Test");
Representation representation = new StandardRepresentation();
String formattedMessage = "[Test] Hello Yoda";
when(formatter.format(description, representation, "Hello %s", "Yoda")).thenReturn(formattedMessage);
assertThat(factory.create(description, representation)).isEqualTo(formattedMessage);
}
Aggregations