本文整理汇总了Java中org.assertj.core.error.ErrorMessageFactory类的典型用法代码示例。如果您正苦于以下问题:Java ErrorMessageFactory类的具体用法?Java ErrorMessageFactory怎么用?Java ErrorMessageFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorMessageFactory类属于org.assertj.core.error包,在下文中一共展示了ErrorMessageFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldHaveParameter
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveParameter(Object actual, String name, String expectedValue,
List<String> actualValues) {
if (expectedValue == null)
return new ShouldHaveParameter(multipleValues(actualValues) ? SHOULD_HAVE_PARAMETER_WITHOUT_VALUE_BUT_HAD_VALUES
: SHOULD_HAVE_PARAMETER_WITHOUT_VALUE_BUT_HAD_VALUE, actual, name, valueDescription(actualValues));
if (noValueIn(actualValues))
return new ShouldHaveParameter(SHOULD_HAVE_PARAMETER_WITH_VALUE_BUT_HAD_NO_VALUE, actual, name, expectedValue);
return new ShouldHaveParameter(multipleValues(actualValues) ? SHOULD_HAVE_PARAMETER_VALUE_BUT_HAD_WRONG_VALUES
: SHOULD_HAVE_PARAMETER_VALUE_BUT_HAD_WRONG_VALUE, actual, name, expectedValue, valueDescription(actualValues));
}
示例2: shouldHaveNoParameter
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveNoParameter(Object actual, String name, String unwantedValue,
List<String> actualValues) {
if (noValueIn(actualValues))
return new ShouldHaveParameter(SHOULD_HAVE_NO_PARAMETER_WITHOUT_VALUE_BUT_FOUND_ONE, actual, name);
return new ShouldHaveParameter(SHOULD_HAVE_NO_PARAMETER_WITH_GIVEN_VALUE_BUT_FOUND_ONE, actual, name,
unwantedValue);
}
示例3: shouldHaveEqualUpperEndpoint
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static <T extends Comparable<T>> ErrorMessageFactory shouldHaveEqualUpperEndpoint(final Range<T> actual,
final Object value) {
return new RangeShouldHaveUpperEndpointEqual("%n" +
"Expecting:%n" +
" <%s>%n" +
"to have upper endpoint equal to:%n" +
" <%s>%n" +
"but was:%n" +
" <%s>",
actual, value, actual.upperEndpoint());
}
示例4: shouldHaveEqualLowerEndpoint
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static <T extends Comparable<T>> ErrorMessageFactory shouldHaveEqualLowerEndpoint(final Range<T> actual,
final Object value) {
return new RangeShouldHaveLowerEndpointEqual("%n" +
"Expecting:%n" +
" <%s>%n" +
"to have lower endpoint equal to:%n" +
" <%s>%n" +
"but was:%n" +
" <%s>",
actual, value, actual.lowerEndpoint());
}
示例5: shouldContainAtLeastTimes
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldContainAtLeastTimes(final Multiset<?> actual, final Object expected,
final int expectedTimes, final int actualTimes) {
return new MultisetShouldContainAtLeastTimes("%n" +
"Expecting:%n" +
" <%s>%n" +
"to contain:%n" +
" <%s>%n" +
"at least %s times but was found %s times.",
actual, expected, expectedTimes, actualTimes);
}
示例6: shouldContainTimes
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldContainTimes(final Multiset<?> actual, final Object expected,
final int expectedTimes, final int actualTimes) {
return new MultisetShouldContainTimes("%n" +
"Expecting:%n" +
" <%s>%n" +
"to contain:%n" +
" <%s>%n" +
"exactly %s times but was found %s times.",
actual, expected, expectedTimes, actualTimes);
}
示例7: shouldContainAtMostTimes
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldContainAtMostTimes(final Multiset<?> actual, final Object expected,
final int expectedTimes, final int actualTimes) {
return new MultisetShouldContainAtMostTimes("%n" +
"Expecting:%n" +
" <%s>%n" +
"to contain:%n" +
" <%s>%n" +
"at most %s times but was found %s times.",
actual, expected, expectedTimes, actualTimes);
}
示例8: expectAssertionError
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public void expectAssertionError(ErrorMessageFactory errorMessageFactory) {
delegate.expect(new ThrowableMatcher<>(AssertionError.class, errorMessageFactory.create()));
}
示例9: shouldHaveETag
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveETag(Object actual, String expected, String found) {
return new ShouldHaveETag(actual, expected, found);
}
示例10: shouldHaveName
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveName(Object actual, String expected, String found) {
return new ShouldHaveName(actual, expected, found);
}
示例11: shouldHaveContentMd5
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveContentMd5(PutObjectResult actual, String expected) {
return expected == null ? new ShouldHaveContentMd5(actual) : new ShouldHaveContentMd5(actual, expected);
}
示例12: shouldHaveBucketName
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveBucketName(S3Object actual, String expected) {
return expected == null ? new ShouldHaveBucketName(actual) : new ShouldHaveBucketName(actual, expected);
}
示例13: shouldHaveKey
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveKey(S3Object actual, String expected) {
return expected == null ? new ShouldHaveKey(actual) : new ShouldHaveKey(actual, expected);
}
示例14: shouldHaveDisplayName
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldHaveDisplayName(Object actual, String expected, String found) {
return new ShouldHaveDisplayName(actual, expected, found);
}
示例15: shouldBeWithin
import org.assertj.core.error.ErrorMessageFactory; //导入依赖的package包/类
public static ErrorMessageFactory shouldBeWithin(final Date actual, final String fieldDescription,
final int fieldValue) {
return new ShouldBeWithin(actual, fieldDescription, fieldValue);
}