use of org.assertj.core.test.Name in project assertj-core by joel-costigliola.
the class IterableAssert_extractingResultOf_Test method setUpOnce.
@BeforeClass
public static void setUpOnce() {
yoda = new FluentJedi(new Name("Yoda"), 800, false);
vader = new FluentJedi(new Name("Darth Vader"), 50, true);
jedis = newArrayList(yoda, vader);
}
use of org.assertj.core.test.Name in project assertj-core by joel-costigliola.
the class IterableAssert_extracting_Test method setUp.
@Before
public void setUp() {
yoda = new Employee(1L, new Name("Yoda"), 800);
luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
employees = newArrayList(yoda, luke);
fellowshipOfTheRing.add(TolkienCharacter.of("Frodo", 33, HOBBIT));
fellowshipOfTheRing.add(TolkienCharacter.of("Sam", 38, HOBBIT));
fellowshipOfTheRing.add(TolkienCharacter.of("Gandalf", 2020, MAIA));
fellowshipOfTheRing.add(TolkienCharacter.of("Legolas", 1000, ELF));
fellowshipOfTheRing.add(TolkienCharacter.of("Pippin", 28, HOBBIT));
fellowshipOfTheRing.add(TolkienCharacter.of("Gimli", 139, DWARF));
fellowshipOfTheRing.add(TolkienCharacter.of("Aragorn", 87, MAN));
fellowshipOfTheRing.add(TolkienCharacter.of("Boromir", 37, MAN));
}
use of org.assertj.core.test.Name in project assertj-core by joel-costigliola.
the class IterableAssert_extracting_Test method should_allow_assertions_on_null_property_values_extracted_from_given_iterable.
@Test
public void should_allow_assertions_on_null_property_values_extracted_from_given_iterable() {
yoda.name.setFirst(null);
assertThat(employees).extracting("name.first").as("not null property but null nested property").containsOnly(null, "Luke");
yoda.setName(null);
assertThat(employees).extracting("name.first").as("extract nested property when top property is null").containsOnly(null, "Luke");
assertThat(employees).extracting("name").as("null property").containsOnly(null, new Name("Luke", "Skywalker"));
}
use of org.assertj.core.test.Name in project assertj-core by joel-costigliola.
the class ShouldBeEqualByComparingFieldByFieldRecursively_create_Test method should_not_fall_with_npe_if_field_of_one_of_compared_objects_is_null.
public void should_not_fall_with_npe_if_field_of_one_of_compared_objects_is_null() {
final Name actualName = new Name("Andy");
final Name nullName = new Name(null);
Throwable error = ThrowableAssert.catchThrowable(new ThrowableAssert.ThrowingCallable() {
@Override
public void call() throws Throwable {
assertThat(actualName).isEqualToComparingFieldByFieldRecursively(nullName);
}
});
assertThat(error).isNotExactlyInstanceOf(NullPointerException.class);
}
use of org.assertj.core.test.Name in project assertj-core by joel-costigliola.
the class FieldSupport_fieldValues_Test method setUpOnce.
@Before
public void setUpOnce() {
yoda = new Employee(1L, new Name("Yoda"), 800);
luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
employees = newArrayList(yoda, luke);
}
Aggregations