org.assertj.core.api.AbstractIterableAssert.usingDefaultElementComparator()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(68)

本文整理了Java中org.assertj.core.api.AbstractIterableAssert.usingDefaultElementComparator()方法的一些代码示例,展示了AbstractIterableAssert.usingDefaultElementComparator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractIterableAssert.usingDefaultElementComparator()方法的具体详情如下:
包路径:org.assertj.core.api.AbstractIterableAssert
类名称:AbstractIterableAssert
方法名:usingDefaultElementComparator

AbstractIterableAssert.usingDefaultElementComparator介绍

暂无

代码示例

代码示例来源:origin: org.assertj/assertj-core

@Override
@CheckReturnValue
public SELF usingDefaultElementComparator() {
 lists = Lists.instance();
 return super.usingDefaultElementComparator();
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Should be used after any methods changing the elements type like {@link #extracting(Extractor)} as it will propagate the correct
 * assertions state, that is everyting but the element comparator (since the element type has changed).
 */
private <V> AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> newListAssertInstanceForMethodsChangingElementType(List<V> values) {
 if (actual instanceof SortedSet) {
  // Reset the natural element comparator set when building an iterable assert instance for a SortedSet as it is likely not
  // compatible with extracted values type, example with a SortedSet<Person> using a comparator on the Person's age, after
  // extracting names we get a a List<String> which is mot suitable for the age comparator
  usingDefaultElementComparator();
 }
 return newListAssertInstance(values).withAssertionState(myself);
}

代码示例来源:origin: joel-costigliola/assertj-core

@Override
@CheckReturnValue
public SELF usingDefaultElementComparator() {
 lists = Lists.instance();
 return super.usingDefaultElementComparator();
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Should be used after any methods changing the elements type like {@link #extracting(Function)} as it will propagate the correct
 * assertions state, that is everyting but the element comparator (since the element type has changed).
 */
private <V> AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>> newListAssertInstanceForMethodsChangingElementType(List<V> values) {
 if (actual instanceof SortedSet) {
  // Reset the natural element comparator set when building an iterable assert instance for a SortedSet as it is likely not
  // compatible with extracted values type, example with a SortedSet<Person> using a comparator on the Person's age, after
  // extracting names we get a a List<String> which is mot suitable for the age comparator
  usingDefaultElementComparator();
 }
 return newListAssertInstance(values).withAssertionState(myself);
}

代码示例来源:origin: org.assertj/assertj-core-java8

@Override
public S usingDefaultElementComparator() {
  super.usingDefaultElementComparator();
  lists = Lists.instance();
  return myself;
}

相关文章

微信公众号

最新文章

更多