Skip to content

Commit

Permalink
Upgrade to Assertj 3.17.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eddumelendez authored and snicoll committed Sep 7, 2020
1 parent f50927f commit db8d117
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion spring-boot-project/spring-boot-dependencies/build.gradle
Expand Up @@ -102,7 +102,7 @@ bom {
]
}
}
library("AssertJ", "3.16.1") {
library("AssertJ", "3.17.2") {
group("org.assertj") {
modules = [
"assertj-core"
Expand Down
Expand Up @@ -99,7 +99,7 @@ void bindToArrayWhenNestedShouldReturnPopulatedArray() {
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);
}
Expand Down
Expand Up @@ -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) {
Expand Down
Expand Up @@ -50,10 +50,10 @@ void detectAndParseWhenIso8601ShouldReturnPeriod() {

@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
Expand All @@ -66,32 +66,32 @@ void detectAndParseWhenSimpleWeeksShouldReturnPeriod() {

@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
Expand Down Expand Up @@ -168,13 +168,13 @@ void parseIso8601WhenSimpleShouldThrowException() {

@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
Expand Down

0 comments on commit db8d117

Please sign in to comment.