use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class ObjectArrayAssert_usingElementComparatorOnFields_Test method should_be_able_to_use_a_comparator_for_element_fields_with_specified_type_using_element_comparator_on_fields.
@Test
public void should_be_able_to_use_a_comparator_for_element_fields_with_specified_type_using_element_comparator_on_fields() {
Jedi actual = new Jedi("Yoda", "green");
Jedi other = new Jedi("Luke", "blue");
assertThat(array(actual)).usingComparatorForElementFieldsWithType(ALWAY_EQUALS_STRING, String.class).usingElementComparatorOnFields("name", "lightSaberColor").contains(other);
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class ObjectAssert_isEqualToIgnoringNullFields_Test method should_be_able_to_use_a_comparator_for_specified_fields.
@Test
public void should_be_able_to_use_a_comparator_for_specified_fields() {
Jedi actual = new Jedi("Yoda", null);
Jedi other = new Jedi("Luke", null);
assertThat(actual).usingComparatorForFields(ALWAY_EQUALS_STRING, "name").isEqualToIgnoringNullFields(other);
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class ObjectAssert_isEqualToIgnoringNullFields_Test method comparators_for_fields_should_have_precedence_over_comparators_for_types.
@Test
public void comparators_for_fields_should_have_precedence_over_comparators_for_types() {
Comparator<String> comparator = (o1, o2) -> o1.compareTo(o2);
Jedi actual = new Jedi("Yoda", null);
Jedi other = new Jedi("Luke", null);
assertThat(actual).usingComparatorForFields(ALWAY_EQUALS_STRING, "name").usingComparatorForType(comparator, String.class).isEqualToIgnoringNullFields(other);
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class ObjectAssert_isEqualToIgnoringNullFields_Test method should_be_able_to_use_a_comparator_for_specified_type.
@Test
public void should_be_able_to_use_a_comparator_for_specified_type() {
Jedi actual = new Jedi("Yoda", null);
Jedi other = new Jedi("Luke", null);
assertThat(actual).usingComparatorForType(ALWAY_EQUALS_STRING, String.class).isEqualToIgnoringNullFields(other);
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class ObjectAssert_isEqualsToComparingFields_Test method comparators_for_fields_should_have_precedence_over_comparators_for_types.
@Test
public void comparators_for_fields_should_have_precedence_over_comparators_for_types() {
Comparator<String> comparator = (o1, o2) -> o1.compareTo(o2);
Jedi actual = new Jedi("Yoda", "green");
Jedi other = new Jedi("Luke", "green");
assertThat(actual).usingComparatorForFields(ALWAY_EQUALS_STRING, "name").usingComparatorForType(comparator, String.class).isEqualToComparingFieldByField(other);
}
Aggregations