use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.
the class FieldsOrPropertiesExtractor_extract_Test method should_prefer_properties_over_fields.
@Test
public void should_prefer_properties_over_fields() {
List<Employee> employees = Arrays.<Employee>asList(new EmployeeWithOverriddenName("Overridden Name"));
List<Object> extractedValues = extract(employees, byName("name"));
assertThat(extractedValues).containsOnly(new Name("Overridden Name"));
}
use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.
the class ObjectAssert_extracting_Test method should_keep_existing_description_if_set_when_extracting_tuples_list.
@Test
public void should_keep_existing_description_if_set_when_extracting_tuples_list() {
Employee luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
thrown.expectAssertionErrorWithMessageContaining("[check luke first name]");
assertThat(luke).as("check luke first name").extracting("name.first").isEmpty();
}
use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.
the class ObjectAssert_extracting_Test method should_use_property_field_names_as_description_when_extracting_tuples_list.
@Test
public void should_use_property_field_names_as_description_when_extracting_tuples_list() {
Employee luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
thrown.expectAssertionErrorWithMessageContaining("[Extracted: name.first, name.last]");
assertThat(luke).extracting("name.first", "name.last").isEmpty();
}
use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.
the class ObjectArrayAssert_filtered_baseTest method setUp.
@Before
public void setUp() {
yoda = new Employee(1L, new Name("Yoda"), 800);
obiwan = new Employee(2L, new Name("Obi"), 800);
luke = new Employee(3L, new Name("Luke", "Skywalker"), 26);
noname = new Employee(4L, null, 10);
employees = new Employee[] { yoda, luke, obiwan, noname };
}
use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.
the class ObjectArrayAssert_extracting_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 = array(yoda, luke);
fellowshipOfTheRing = new TolkienCharacter[8];
fellowshipOfTheRing[0] = TolkienCharacter.of("Frodo", 33, HOBBIT);
fellowshipOfTheRing[1] = TolkienCharacter.of("Sam", 38, HOBBIT);
fellowshipOfTheRing[2] = TolkienCharacter.of("Gandalf", 2020, MAIA);
fellowshipOfTheRing[3] = TolkienCharacter.of("Legolas", 1000, ELF);
fellowshipOfTheRing[4] = TolkienCharacter.of("Pippin", 28, HOBBIT);
fellowshipOfTheRing[5] = TolkienCharacter.of("Gimli", 139, DWARF);
fellowshipOfTheRing[6] = TolkienCharacter.of("Aragorn", 87, MAN);
fellowshipOfTheRing[7] = TolkienCharacter.of("Boromir", 37, MAN);
}
Aggregations