use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToIgnoringNullFields_Test method should_fail_if_actual_is_null.
@Test
public void should_fail_if_actual_is_null() {
thrown.expectAssertionError(actualIsNull());
Jedi other = new Jedi("Yoda", "Green");
objects.assertIsEqualToIgnoringNullFields(someInfo(), null, other, noFieldComparators(), defaultTypeComparators());
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToIgnoringNullFields_Test method should_fail_when_one_of_actual_field_to_compare_can_not_be_found_in_the_other_object.
@Test
public void should_fail_when_one_of_actual_field_to_compare_can_not_be_found_in_the_other_object() {
thrown.expectIntrospectionErrorWithMessageContaining("Can't find any field or property with name 'lightSaberColor'");
Jedi actual = new Jedi("Yoda", "Green");
Employee other = new Employee();
objects.assertIsEqualToIgnoringNullFields(someInfo(), actual, other, noFieldComparators(), defaultTypeComparators());
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToIgnoringNullFields_Test method should_fail_when_a_field_differ.
@Test
public void should_fail_when_a_field_differ() {
AssertionInfo info = someInfo();
Jedi actual = new Jedi("Yoda", "Green");
Jedi other = new Jedi("Soda", "Green");
try {
objects.assertIsEqualToIgnoringNullFields(info, actual, other, noFieldComparators(), defaultTypeComparators());
} catch (AssertionError err) {
verify(failures).failure(info, shouldBeEqualToIgnoringGivenFields(actual, newArrayList("name"), newArrayList((Object) "Yoda"), newArrayList((Object) "Soda"), newArrayList("strangeNotReadablePrivateField")));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class Assumptions_assumeThat_involving_iterable_navigation_Test method setup.
@Before
public void setup() {
yoda = new Jedi("Yoda", "green");
luke = new Jedi("Luke", "green");
jedis = newLinkedHashSet(yoda, luke);
}
use of org.assertj.core.test.Jedi in project assertj-core by joel-costigliola.
the class Assumptions_assumeThat_with_extracting_Test method setup.
@Before
public void setup() {
yoda = new Jedi("Yoda", "green");
luke = new Jedi("Luke", "green");
jedis = newHashSet(yoda, luke);
bart = new CartoonCharacter("Bart Simpson");
lisa = new CartoonCharacter("Lisa Simpson");
maggie = new CartoonCharacter("Maggie Simpson");
homer = new CartoonCharacter("Homer Simpson");
homer.addChildren(bart, lisa, maggie);
pebbles = new CartoonCharacter("Pebbles Flintstone");
fred = new CartoonCharacter("Fred Flintstone");
fred.addChildren(pebbles);
}
Aggregations