Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(gcs/test): replace deprecated test application context initializer class during upgrade to spring boot 2.6.x #1422

Merged
merged 1 commit into from
Dec 23, 2023

Conversation

j-sandy
Copy link
Contributor

@j-sandy j-sandy commented Dec 22, 2023

While upgrading spring boot 2.6.15, encounter below error in front50-gcs module during test compilation:

> Task :front50-gcs:compileTestKotlin FAILED
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (28, 46): Unresolved reference: ConfigFileApplicationContextInitializer
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (39, 18): Only 'const val' can be used in constant expressions
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (39, 19): Unresolved reference: ConfigFileApplicationContextInitializer
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (39, 19): An annotation argument must be a compile-time constant

The root cause is the removal of ConfigFileApplicationContextInitializer class which got deprecated since spring boot 2.4.x in favour of ConfigDataApplicationContextInitializer class from spring boot 2.6.x. To fix this issue replacing the deprecated class with new class.

…alizer class during upgrade to spring boot 2.6.x

While upgrading spring boot 2.6.15, encounter below error in front50-gcs module during test compilation:
```
> Task :front50-gcs:compileTestKotlin FAILED
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (28, 46): Unresolved reference: ConfigFileApplicationContextInitializer
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (39, 18): Only 'const val' can be used in constant expressions
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (39, 19): Unresolved reference: ConfigFileApplicationContextInitializer
e: /front50/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/GcsIntegrationTest.kt: (39, 19): An annotation argument must be a compile-time constant
```
The root cause is the removal of `ConfigFileApplicationContextInitializer` class which got deprecated since [spring boot 2.4.x](https://javadoc.io/doc/org.springframework.boot/spring-boot-test/2.4.4/deprecated-list.html) in favour of `ConfigDataApplicationContextInitializer` class from [spring boot 2.6.x](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.6-Release-Notes#deprecations-from-spring-boot-24).
To fix this issue replacing the deprecated class with new class.
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Dec 23, 2023
@dbyron-sf dbyron-sf merged commit eec0005 into spinnaker:master Dec 23, 2023
2 checks passed
@mergify mergify bot added the auto merged label Dec 23, 2023
@j-sandy j-sandy deleted the initializer-refactor branch December 27, 2023 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants