Search in sources :

Example 16 with Employee

use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.

the class AtomicReferenceArrayAssert_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 AtomicReferenceArray<>(new Employee[] { yoda, luke, obiwan, noname });
}
Also used : Employee(org.assertj.core.test.Employee) Name(org.assertj.core.test.Name) Before(org.junit.Before)

Example 17 with Employee

use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.

the class AtomicReferenceArrayAssert_extracting_Test method setUpOnce.

@BeforeClass
public static void setUpOnce() {
    yoda = new Employee(1L, new Name("Yoda"), 800);
    luke = new Employee(2L, new Name("Luke", "Skywalker"), 26);
    employees = new AtomicReferenceArray<>(array(yoda, luke));
}
Also used : Employee(org.assertj.core.test.Employee) Name(org.assertj.core.test.Name) BeforeClass(org.junit.BeforeClass)

Example 18 with Employee

use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.

the class Objects_assertIsEqualToComparingOnlyGivenFields_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.assertIsEqualToComparingOnlyGivenFields(someInfo(), actual, other, noFieldComparators(), defaultTypeComparators(), "lightSaberColor");
}
Also used : Jedi(org.assertj.core.test.Jedi) Employee(org.assertj.core.test.Employee) ObjectsBaseTest(org.assertj.core.internal.ObjectsBaseTest) Test(org.junit.Test)

Example 19 with Employee

use of org.assertj.core.test.Employee in project assertj-core by joel-costigliola.

the class Objects_assertIsEqualToIgnoringGivenFields_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() {
    Jedi actual = new Jedi("Yoda", "Green");
    Employee other = new Employee();
    thrown.expectIntrospectionErrorWithMessageContaining("Can't find any field or property with name 'lightSaberColor'");
    objects.assertIsEqualToIgnoringGivenFields(someInfo(), actual, other, noFieldComparators(), defaultTypeComparators(), "name");
}
Also used : Jedi(org.assertj.core.test.Jedi) Employee(org.assertj.core.test.Employee) ObjectsBaseTest(org.assertj.core.internal.ObjectsBaseTest) Test(org.junit.Test)

Example 20 with Employee

use of org.assertj.core.test.Employee 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());
}
Also used : Jedi(org.assertj.core.test.Jedi) Employee(org.assertj.core.test.Employee) ObjectsBaseTest(org.assertj.core.internal.ObjectsBaseTest) Test(org.junit.Test)

Aggregations

Employee (org.assertj.core.test.Employee)27 Name (org.assertj.core.test.Name)21 Test (org.junit.Test)17 Before (org.junit.Before)9 Extractors.byName (org.assertj.core.extractor.Extractors.byName)6 HashMap (java.util.HashMap)3 Map (java.util.Map)3 ObjectsBaseTest (org.assertj.core.internal.ObjectsBaseTest)3 Jedi (org.assertj.core.test.Jedi)3 Tuple (org.assertj.core.groups.Tuple)2 BeforeClass (org.junit.BeforeClass)1