Upgrade to Assertj 3.17.2

See gh-23179
This commit is contained in:
Eddú Meléndez 2020-09-05 21:26:38 -05:00 committed by Stephane Nicoll
parent f50927f7a1
commit db8d117d38
4 changed files with 32 additions and 32 deletions

View File

@ -102,7 +102,7 @@ bom {
]
}
}
library("AssertJ", "3.16.1") {
library("AssertJ", "3.17.2") {
group("org.assertj") {
modules = [
"assertj-core"

View File

@ -99,7 +99,7 @@ class ArrayBinderTests {
ResolvableType type = ResolvableType.forArrayComponent(INTEGER_ARRAY.getType());
Bindable<Integer[][]> target = Bindable.of(type);
Integer[][] result = this.binder.bind("foo", target).get();
assertThat(result).hasSize(2);
assertThat(result).hasDimensions(2, 2);
assertThat(result[0]).containsExactly(1, 2);
assertThat(result[1]).containsExactly(3, 4);
}

View File

@ -41,21 +41,21 @@ class NumberToPeriodConverterTests {
@ConversionServiceTest
void convertWhenSimpleWithoutSuffixShouldReturnPeriod(ConversionService conversionService) {
assertThat(convert(conversionService, 10)).isEqualTo(Period.ofDays(10));
assertThat(convert(conversionService, +10)).isEqualTo(Period.ofDays(10));
assertThat(convert(conversionService, -10)).isEqualTo(Period.ofDays(-10));
assertThat(convert(conversionService, 10)).hasDays(10);
assertThat(convert(conversionService, +10)).hasDays(10);
assertThat(convert(conversionService, -10)).hasDays(-10);
}
@ConversionServiceTest
void convertWhenSimpleWithoutSuffixButWithAnnotationShouldReturnPeriod(ConversionService conversionService) {
assertThat(convert(conversionService, 10, ChronoUnit.DAYS)).isEqualTo(Period.ofDays(10));
assertThat(convert(conversionService, -10, ChronoUnit.DAYS)).isEqualTo(Period.ofDays(-10));
assertThat(convert(conversionService, 10, ChronoUnit.DAYS)).hasDays(10);
assertThat(convert(conversionService, -10, ChronoUnit.DAYS)).hasDays(-10);
assertThat(convert(conversionService, 10, ChronoUnit.WEEKS)).isEqualTo(Period.ofWeeks(10));
assertThat(convert(conversionService, -10, ChronoUnit.WEEKS)).isEqualTo(Period.ofWeeks(-10));
assertThat(convert(conversionService, 10, ChronoUnit.MONTHS)).isEqualTo(Period.ofMonths(10));
assertThat(convert(conversionService, -10, ChronoUnit.MONTHS)).isEqualTo(Period.ofMonths(-10));
assertThat(convert(conversionService, 10, ChronoUnit.YEARS)).isEqualTo(Period.ofYears(10));
assertThat(convert(conversionService, -10, ChronoUnit.YEARS)).isEqualTo(Period.ofYears(-10));
assertThat(convert(conversionService, 10, ChronoUnit.MONTHS)).hasMonths(10);
assertThat(convert(conversionService, -10, ChronoUnit.MONTHS)).hasMonths(-10);
assertThat(convert(conversionService, 10, ChronoUnit.YEARS)).hasYears(10);
assertThat(convert(conversionService, -10, ChronoUnit.YEARS)).hasYears(-10);
}
private Period convert(ConversionService conversionService, Integer source) {

View File

@ -50,10 +50,10 @@ class PeriodStyleTests {
@Test
void detectAndParseWhenSimpleDaysShouldReturnPeriod() {
assertThat(PeriodStyle.detectAndParse("10d")).isEqualTo(Period.ofDays(10));
assertThat(PeriodStyle.detectAndParse("10D")).isEqualTo(Period.ofDays(10));
assertThat(PeriodStyle.detectAndParse("+10d")).isEqualTo(Period.ofDays(10));
assertThat(PeriodStyle.detectAndParse("-10D")).isEqualTo(Period.ofDays(-10));
assertThat(PeriodStyle.detectAndParse("10d")).hasDays(10);
assertThat(PeriodStyle.detectAndParse("10D")).hasDays(10);
assertThat(PeriodStyle.detectAndParse("+10d")).hasDays(10);
assertThat(PeriodStyle.detectAndParse("-10D")).hasDays(-10);
}
@Test
@ -66,32 +66,32 @@ class PeriodStyleTests {
@Test
void detectAndParseWhenSimpleMonthsShouldReturnPeriod() {
assertThat(PeriodStyle.detectAndParse("10m")).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.detectAndParse("10M")).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.detectAndParse("+10m")).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.detectAndParse("-10M")).isEqualTo(Period.ofMonths(-10));
assertThat(PeriodStyle.detectAndParse("10m")).hasMonths(10);
assertThat(PeriodStyle.detectAndParse("10M")).hasMonths(10);
assertThat(PeriodStyle.detectAndParse("+10m")).hasMonths(10);
assertThat(PeriodStyle.detectAndParse("-10M")).hasMonths(-10);
}
@Test
void detectAndParseWhenSimpleYearsShouldReturnPeriod() {
assertThat(PeriodStyle.detectAndParse("10y")).isEqualTo(Period.ofYears(10));
assertThat(PeriodStyle.detectAndParse("10Y")).isEqualTo(Period.ofYears(10));
assertThat(PeriodStyle.detectAndParse("+10y")).isEqualTo(Period.ofYears(10));
assertThat(PeriodStyle.detectAndParse("-10Y")).isEqualTo(Period.ofYears(-10));
assertThat(PeriodStyle.detectAndParse("10y")).hasYears(10);
assertThat(PeriodStyle.detectAndParse("10Y")).hasYears(10);
assertThat(PeriodStyle.detectAndParse("+10y")).hasYears(10);
assertThat(PeriodStyle.detectAndParse("-10Y")).hasYears(-10);
}
@Test
void detectAndParseWhenSimpleWithoutSuffixShouldReturnPeriod() {
assertThat(PeriodStyle.detectAndParse("10")).isEqualTo(Period.ofDays(10));
assertThat(PeriodStyle.detectAndParse("+10")).isEqualTo(Period.ofDays(10));
assertThat(PeriodStyle.detectAndParse("-10")).isEqualTo(Period.ofDays(-10));
assertThat(PeriodStyle.detectAndParse("10")).hasDays(10);
assertThat(PeriodStyle.detectAndParse("+10")).hasDays(10);
assertThat(PeriodStyle.detectAndParse("-10")).hasDays(-10);
}
@Test
void detectAndParseWhenSimpleWithoutSuffixButWithChronoUnitShouldReturnPeriod() {
assertThat(PeriodStyle.detectAndParse("10", ChronoUnit.MONTHS)).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.detectAndParse("+10", ChronoUnit.MONTHS)).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.detectAndParse("-10", ChronoUnit.MONTHS)).isEqualTo(Period.ofMonths(-10));
assertThat(PeriodStyle.detectAndParse("10", ChronoUnit.MONTHS)).hasMonths(10);
assertThat(PeriodStyle.detectAndParse("+10", ChronoUnit.MONTHS)).hasMonths(10);
assertThat(PeriodStyle.detectAndParse("-10", ChronoUnit.MONTHS)).hasMonths(-10);
}
@Test
@ -168,13 +168,13 @@ class PeriodStyleTests {
@Test
void parseSimpleShouldParse() {
assertThat(PeriodStyle.SIMPLE.parse("10m")).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.SIMPLE.parse("10m")).hasMonths(10);
}
@Test
void parseSimpleWithUnitShouldUseUnitAsFallback() {
assertThat(PeriodStyle.SIMPLE.parse("10m", ChronoUnit.DAYS)).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.SIMPLE.parse("10", ChronoUnit.MONTHS)).isEqualTo(Period.ofMonths(10));
assertThat(PeriodStyle.SIMPLE.parse("10m", ChronoUnit.DAYS)).hasMonths(10);
assertThat(PeriodStyle.SIMPLE.parse("10", ChronoUnit.MONTHS)).hasMonths(10);
}
@Test