use of org.assertj.core.internal.Iterables 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");
}
use of org.assertj.core.internal.Iterables in project assertj-core by joel-costigliola.
the class ListAssert_usingElementComparatorOnFields_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 = ((ExtendedByTypesComparator) ((ComparatorBasedComparisonStrategy) lists.getComparisonStrategy()).getComparator()).getComparator();
assertThat(listsElementComparator).isInstanceOf(OnFieldsComparator.class);
assertThat(((OnFieldsComparator) listsElementComparator).getFields()).containsOnly("field");
Comparator<?> iterablesElementComparator = ((ExtendedByTypesComparator) ((ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy()).getComparator()).getComparator();
assertThat(iterablesElementComparator).isInstanceOf(OnFieldsComparator.class);
assertThat(((OnFieldsComparator) iterablesElementComparator).getFields()).containsOnly("field");
}
use of org.assertj.core.internal.Iterables in project assertj-core by joel-costigliola.
the class ListAssert_usingFieldByFieldElementComparator_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 = ((ExtendedByTypesComparator) ((ComparatorBasedComparisonStrategy) lists.getComparisonStrategy()).getComparator()).getComparator();
assertThat(listsElementComparator).isInstanceOf(FieldByFieldComparator.class);
Comparator<?> iterablesElementComparator = ((ExtendedByTypesComparator) ((ComparatorBasedComparisonStrategy) iterables.getComparisonStrategy()).getComparator()).getComparator();
assertThat(iterablesElementComparator).isInstanceOf(FieldByFieldComparator.class);
}
Aggregations