Search in sources :

Example 1 with IgnoringFieldsComparator

use of org.assertj.core.internal.IgnoringFieldsComparator in project assertj-core by joel-costigliola.

the class IterableAssert_usingElementComparatorIgnoringFields_Test method verify_internal_effects.

@Override
protected void verify_internal_effects() {
    Iterables iterables = getIterables(assertions);
    assertThat(iterables).isNotSameAs(iterablesBefore);
    assertThat(iterables.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
    ComparatorBasedComparisonStrategy strategy = (ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy();
    assertThat(strategy.getComparator()).isInstanceOf(ExtendedByTypesComparator.class);
    assertThat(((IgnoringFieldsComparator) ((ExtendedByTypesComparator) strategy.getComparator()).getComparator()).getFields()).containsOnly("field");
}
Also used : IgnoringFieldsComparator(org.assertj.core.internal.IgnoringFieldsComparator) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) Iterables(org.assertj.core.internal.Iterables)

Example 2 with IgnoringFieldsComparator

use of org.assertj.core.internal.IgnoringFieldsComparator in project assertj-core by joel-costigliola.

the class ObjectArrayAssert_usingElementComparatorIgnoringFields_Test method verify_internal_effects.

@Override
protected void verify_internal_effects() {
    ObjectArrays iterables = getArrays(assertions);
    assertThat(iterables).isNotSameAs(arraysBefore);
    assertThat(iterables.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
    ComparatorBasedComparisonStrategy strategy = (ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy();
    assertThat(strategy.getComparator()).isInstanceOf(ExtendedByTypesComparator.class);
    assertThat(((IgnoringFieldsComparator) ((ExtendedByTypesComparator) strategy.getComparator()).getComparator()).getFields()).containsOnly("field");
}
Also used : IgnoringFieldsComparator(org.assertj.core.internal.IgnoringFieldsComparator) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) ObjectArrays(org.assertj.core.internal.ObjectArrays)

Example 3 with IgnoringFieldsComparator

use of org.assertj.core.internal.IgnoringFieldsComparator in project assertj-core by joel-costigliola.

the class AtomicReferenceArrayAssert_usingElementComparatorIgnoringFields_Test method verify_internal_effects.

@Override
protected void verify_internal_effects() {
    ObjectArrays iterables = getArrays(assertions);
    assertThat(iterables).isNotSameAs(arraysBefore);
    assertThat(iterables.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
    ComparatorBasedComparisonStrategy strategy = (ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy();
    assertThat(strategy.getComparator()).isInstanceOf(ExtendedByTypesComparator.class);
    assertThat(((IgnoringFieldsComparator) ((ExtendedByTypesComparator) strategy.getComparator()).getComparator()).getFields()).containsOnly("field");
}
Also used : IgnoringFieldsComparator(org.assertj.core.internal.IgnoringFieldsComparator) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) ObjectArrays(org.assertj.core.internal.ObjectArrays)

Example 4 with IgnoringFieldsComparator

use of org.assertj.core.internal.IgnoringFieldsComparator in project assertj-core by joel-costigliola.

the class ListAssert_usingElementComparatorIgnoringFields_Test method verify_internal_effects.

@Override
protected void verify_internal_effects() {
    Lists lists = getLists(assertions);
    Iterables iterables = getIterables(assertions);
    assertThat(lists).isNotSameAs(listsBefore);
    assertThat(iterables).isNotSameAs(iterablesBefore);
    assertThat(iterables.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
    assertThat(lists.getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);
    Comparator<?> listsElementComparator = ((ComparatorBasedComparisonStrategy) lists.getComparisonStrategy()).getComparator();
    assertThat(listsElementComparator).isInstanceOf(ExtendedByTypesComparator.class);
    assertThat(((IgnoringFieldsComparator) ((ExtendedByTypesComparator) listsElementComparator).getComparator()).getFields()).containsOnly("field");
    Comparator<?> iterablesElementComparator = ((ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy()).getComparator();
    assertThat(iterablesElementComparator).isInstanceOf(ExtendedByTypesComparator.class);
    assertThat(((IgnoringFieldsComparator) ((ExtendedByTypesComparator) iterablesElementComparator).getComparator()).getFields()).containsOnly("field");
}
Also used : IgnoringFieldsComparator(org.assertj.core.internal.IgnoringFieldsComparator) Lists(org.assertj.core.internal.Lists) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) Iterables(org.assertj.core.internal.Iterables)

Aggregations

ComparatorBasedComparisonStrategy (org.assertj.core.internal.ComparatorBasedComparisonStrategy)4 IgnoringFieldsComparator (org.assertj.core.internal.IgnoringFieldsComparator)4 Iterables (org.assertj.core.internal.Iterables)2 ObjectArrays (org.assertj.core.internal.ObjectArrays)2 Lists (org.assertj.core.internal.Lists)1