本文整理汇总了Java中org.assertj.core.api.AbstractObjectAssert类的典型用法代码示例。如果您正苦于以下问题:Java AbstractObjectAssert类的具体用法?Java AbstractObjectAssert怎么用?Java AbstractObjectAssert使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractObjectAssert类属于org.assertj.core.api包,在下文中一共展示了AbstractObjectAssert类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: then
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
/**
* Delegate call to {@link org.assertj.core.api.Assertions#assertThat(T)}
*/
default <T> AbstractObjectAssert<?, T> then(T actual) {
fluentBdd().verification.recordThen(this);
return DELEGATE.assertThat(actual);
}
示例2: resultOf
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
public static <$ActualResult> AbstractObjectAssert<?, $ActualResult> resultOf(
CheckedSupplier<$ActualResult> whenStep) {
return assertThat(result(whenStep));
}
示例3: assertAt
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private <T> AbstractObjectAssert<?, T> assertAt(int index, Class<T> type) {
AbstractObjectAssert<?, ?> anAssert = Assertions.assertThat(events.get(index));
anAssert.isInstanceOf(type);
return (AbstractObjectAssert<?, T>) anAssert;
}
示例4: assertFirst
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
public <T> AbstractObjectAssert<?, T> assertFirst(Class<T> type) {
return this.assertAt(0, type);
}
示例5: assertLast
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
public <T> AbstractObjectAssert<?, T> assertLast(Class<T> type) {
return this.assertAt(events.size() - 1, type);
}
示例6: and
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
/**
* Delegate call to {@link org.assertj.core.api.Assertions#assertThat(T)}
*/
default <T> AbstractObjectAssert<?, T> and(T actual) {
fluentBdd().verification.recordThen(this);
return DELEGATE.assertThat(actual);
}
示例7: minecraftCommand
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
private AbstractObjectAssert<?, CommandPartBuffer> minecraftCommand() {
isNotNull();
return assertThat(actual.getMinecraftCommand()).as(description("minecraftCommand"));
}
示例8: assertStat
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
private AbstractObjectAssert<?, Number> assertStat(String key) {
return assertThat((Number) cacheStatistics.getKnownStatistics().get(key).value());
}
示例9: assertStat
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
private AbstractObjectAssert<?, Number> assertStat(String key) {
return assertThat((Number) onHeap.getKnownStatistics().get(key).value());
}
示例10: method
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
public AbstractObjectAssert<?, Method> method() {
return Assertions.assertThat(actual.getMethod()).as(navigationDescription("method"));
}
示例11: assertThat
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
/**
* Delegate call to public static <T> org.assertj.core.api.AbstractObjectAssert<?, T> org.assertj.core.api.Assertions.assertThat(T)
* {@link org.assertj.core.api.Assertions#assertThat(java.lang.Object)}
*/
default <T> AbstractObjectAssert<?, T> assertThat(T assertion) {
return Assertions.assertThat(assertion);
}
示例12: extractingJsonPathValue
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
/**
* Extract the value at the given JSON path for further object assertions.
* @param expression the {@link JsonPath} expression
* @param args arguments to parameterize the {@code JsonPath} expression with, using
* formatting specifiers defined in {@link String#format(String, Object...)}
* @return a new assertion object whose object under test is the extracted item
* @throws AssertionError if the path is not valid
*/
public AbstractObjectAssert<?, Object> extractingJsonPathValue(
CharSequence expression, Object... args) {
return Assertions.assertThat(new JsonPathValue(expression, args).getValue(false));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:JsonContentAssert.java
示例13: extractingJsonPathNumberValue
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
/**
* Extract the number value at the given JSON path for further object assertions.
* @param expression the {@link JsonPath} expression
* @param args arguments to parameterize the {@code JsonPath} expression with, using
* formatting specifiers defined in {@link String#format(String, Object...)}
* @return a new assertion object whose object under test is the extracted item
* @throws AssertionError if the path is not valid or does not result in a number
*/
public AbstractObjectAssert<?, Number> extractingJsonPathNumberValue(
CharSequence expression, Object... args) {
return Assertions.assertThat(
extractingJsonPathValue(expression, args, Number.class, "a number"));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:JsonContentAssert.java
示例14: expect
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
/**
* A little wrapper over {@code assertThat} that just mention that this what we expect from the test. So if the
* expectation fails, it's probably the test that is wrong, not the implementation.
*
* @param actual actual value
* @return an AssertJ assertion
*/
protected static <T> AbstractObjectAssert<?, T> expect(T actual) {
return assertThat(actual);
}
示例15: extractingValue
import org.assertj.core.api.AbstractObjectAssert; //导入依赖的package包/类
/**
* Chain assertion on the content of the {@link Optional}.
* <p>
* Example :
*
* <pre><code class='java'> Optional<Number> optional = Optional.of(12L);
*
* assertThat(optional).extractingValue().isInstanceOf(Long.class);</code></pre>
*
* @return a new {@link AbstractObjectAssert} for assertions chaining on the content of the Optional.
* @throws AssertionError if the actual {@link Optional} is {@code null}.
* @throws AssertionError if the actual {@link Optional} contains a null instance.
*/
public AbstractObjectAssert<?, T> extractingValue() {
isPresent();
return assertThat(actual.get());
}