Skip to content

Commit

Permalink
Merge pull request #1917 from HedvigInsurance/feature/bump-compose
Browse files Browse the repository at this point in the history
Bump kotlin and fix tests
  • Loading branch information
StylianosGakis authored Dec 9, 2023
2 parents 08e37d8 + cb07c02 commit 10a7caf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class GetUpcomingRenewalRemindersUseCaseTest {
apolloClient,
clock,
)
val upcomingRenewalLocalDate = clock.now().plus(1.days).toLocalDateTime(TimeZone.UTC).date
val upcomingRenewalLocalDate = clock.now().plus(1.days).toLocalDateTime(TimeZone.currentSystemDefault()).date
apolloClient.enqueueTestResponse(
GetUpcomingRenewalReminderQuery(),
GetUpcomingRenewalReminderQuery.Data(OctopusFakeResolver) {
Expand Down Expand Up @@ -94,7 +94,7 @@ class GetUpcomingRenewalRemindersUseCaseTest {
}
}
upcomingChangedAgreement = buildAgreement {
activeFrom = clock.now().plus((index + 1).days).toLocalDateTime(TimeZone.UTC).date
activeFrom = clock.now().plus((index + 1).days).toLocalDateTime(TimeZone.currentSystemDefault()).date
certificateUrl = "url#$index"
creationCause = AgreementCreationCause.RENEWAL
}
Expand All @@ -110,7 +110,7 @@ class GetUpcomingRenewalRemindersUseCaseTest {
assertThat(list).isNotNull()
list!!.forEachIndexed { index, upcomingRenewal ->
assertThat(upcomingRenewal.renewalDate).isEqualTo(
clock.now().plus((index + 1).days).toLocalDateTime(TimeZone.UTC).date,
clock.now().plus((index + 1).days).toLocalDateTime(TimeZone.currentSystemDefault()).date,
)
assertThat(upcomingRenewal.contractDisplayName).isEqualTo("#$index")
assertThat(upcomingRenewal.draftCertificateUrl).isEqualTo("url#$index")
Expand All @@ -124,7 +124,7 @@ class GetUpcomingRenewalRemindersUseCaseTest {
apolloClient,
clock,
)
val upcomingRenewalLocalDate = clock.now().minus(1.days).toLocalDateTime(TimeZone.UTC).date
val upcomingRenewalLocalDate = clock.now().minus(1.days).toLocalDateTime(TimeZone.currentSystemDefault()).date
apolloClient.enqueueTestResponse(
GetUpcomingRenewalReminderQuery(),
GetUpcomingRenewalReminderQuery.Data(OctopusFakeResolver) {
Expand Down Expand Up @@ -170,7 +170,7 @@ class GetUpcomingRenewalRemindersUseCaseTest {
}
}
upcomingChangedAgreement = buildAgreement {
activeFrom = clock.now().minus(index.days).toLocalDateTime(TimeZone.UTC).date
activeFrom = clock.now().minus(index.days).toLocalDateTime(TimeZone.currentSystemDefault()).date
certificateUrl = "url#$index"
}
}
Expand Down Expand Up @@ -210,7 +210,8 @@ class GetUpcomingRenewalRemindersUseCaseTest {
}
}
upcomingChangedAgreement = buildAgreement {
activeFrom = (clock.now() + renewalOffsets[index]!!).toLocalDateTime(TimeZone.UTC).date
activeFrom =
(clock.now() + renewalOffsets[index]!!).toLocalDateTime(TimeZone.currentSystemDefault()).date
certificateUrl = "url#$index"
creationCause = AgreementCreationCause.RENEWAL
}
Expand All @@ -227,15 +228,21 @@ class GetUpcomingRenewalRemindersUseCaseTest {
assertThat(list!!.size).isEqualTo(3)

assertThat(list[0].contractDisplayName).isEqualTo("#1")
assertThat(list[0].renewalDate).isEqualTo(clock.now().plus(renewalOffsets[1]!!).toLocalDateTime(TimeZone.UTC).date)
assertThat(list[0].renewalDate).isEqualTo(
clock.now().plus(renewalOffsets[1]!!).toLocalDateTime(TimeZone.currentSystemDefault()).date,
)
assertThat(list[0].draftCertificateUrl).isEqualTo("url#1")

assertThat(list[1].contractDisplayName).isEqualTo("#3")
assertThat(list[1].renewalDate).isEqualTo(clock.now().plus(renewalOffsets[3]!!).toLocalDateTime(TimeZone.UTC).date)
assertThat(list[1].renewalDate).isEqualTo(
clock.now().plus(renewalOffsets[3]!!).toLocalDateTime(TimeZone.currentSystemDefault()).date,
)
assertThat(list[1].draftCertificateUrl).isEqualTo("url#3")

assertThat(list[2].contractDisplayName).isEqualTo("#4")
assertThat(list[2].renewalDate).isEqualTo(clock.now().plus(renewalOffsets[4]!!).toLocalDateTime(TimeZone.UTC).date)
assertThat(list[2].renewalDate).isEqualTo(
clock.now().plus(renewalOffsets[4]!!).toLocalDateTime(TimeZone.currentSystemDefault()).date,
)
assertThat(list[2].draftCertificateUrl).isEqualTo("url#4")
}

Expand All @@ -259,7 +266,7 @@ class GetUpcomingRenewalRemindersUseCaseTest {
}
}
upcomingChangedAgreement = buildAgreement {
activeFrom = (clock.now().plus(1.days)).toLocalDateTime(TimeZone.UTC).date
activeFrom = (clock.now().plus(1.days)).toLocalDateTime(TimeZone.currentSystemDefault()).date
certificateUrl = "url#1"
creationCause = AgreementCreationCause.MIDTERM_CHANGE
}
Expand All @@ -285,7 +292,7 @@ class GetUpcomingRenewalRemindersUseCaseTest {
}
}
upcomingChangedAgreement = buildAgreement {
activeFrom = (clock.now().plus(1.days)).toLocalDateTime(TimeZone.UTC).date
activeFrom = (clock.now().plus(1.days)).toLocalDateTime(TimeZone.currentSystemDefault()).date
certificateUrl = "url#2"
creationCause = AgreementCreationCause.RENEWAL
}
Expand All @@ -299,7 +306,9 @@ class GetUpcomingRenewalRemindersUseCaseTest {
val list = result2.getOrNull()
assertThat(list).isNotNull()
assertThat(list!!.size).isEqualTo(1)
assertThat(list.first().renewalDate).isEqualTo(clock.now().plus(1.days).toLocalDateTime(TimeZone.UTC).date)
assertThat(list.first().renewalDate).isEqualTo(
clock.now().plus(1.days).toLocalDateTime(TimeZone.currentSystemDefault()).date,
)
assertThat(list.first().draftCertificateUrl).isEqualTo("url#2")
}

Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ datadogPlugin = "1.12.0"
doctor = "0.9.1"
easylauncher = "6.2.0"
googleServices = "4.4.0"
kotlin = "1.9.20"
kotlin = "1.9.21"
kotlinter = "4.1.0"
ktor = "2.3.6"
license = "0.9.3"
molecule = "1.3.0"
molecule = "1.3.1"
squareSortDependencies = "0.4"

# Other versions sorted alphabetically
Expand All @@ -31,7 +31,7 @@ androidx-activity-core = "1.8.1"
androidx-annotation = "1.7.0"
androidx-arch-testing = "2.2.0"
androidx-composeBom = "2023.10.01"
androidx-composeCompiler = "1.5.4"
androidx-composeCompiler = "1.5.6"
androidx-datastore = "1.0.0"
androidx-lifecycle = "2.6.2"
androidx-navigation = "2.7.5"
Expand Down

0 comments on commit 10a7caf

Please sign in to comment.