You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to upgrade DGS to the latest version 9.1.2. So I changed the dependency in Gradle:
from com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:8.5.8
to com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:9.1.2
But then when starting an application there is a deprecation warning in the log
DEPRECATION WARNING - This project is using the deprecated 'graphql-dgs-spring-boot-starter'. Please switch to 'graphql-dgs-spring-graphql-starter'. For more context: https://netflix.github.io/dgs/spring-graphql-integration
But when changing the dependency to com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter:9.1.2, some unit tests stopped working. See the details bellow.
Expected behavior
When overriding the Spring Boot (SB) property spring.autoconfigure.exclude e.g. in a unit test by the @TestProperties annotation, the value set in the annotation should be present in the application context.
Actual behavior
Setting the spring.autoconfigure.exclude e.g. in unit test by the @TestProperties appends the value to the configuration property already defined e.g. in application.yaml file. Does not override it.
Steps to reproduce
In this repository, the issue is reproduced.
Experiments in the repository show that:
with com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter
the autoconfiguration exclusion behaves as expected
with com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter
until DGS version 8.5.3 autoconfiguration exclusion behaves as expected
since DGS version 8.5.4 autoconfiguration exclusion behavior changed
More info
I checked the commits between those two versions, and it seems that the cause of this new behavior could be the class com.netflix.graphql.dgs.springgraphql.autoconfig.ExcludeAutoConfigurationsEnvironmentPostProcessor. It manipulates the spring.autoconfigure.exclude property in some way. Also, this class is not present in com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter but is present in com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter which also supports my assumption.
In my project, I need to exclude some autoconfiguration for all unit tests, but in some cases, I want to keep it included and that is why I changed the spring.autoconfigure.exclude just for a few tests out of thousands.
The text was updated successfully, but these errors were encountered:
Sorry for the late reply, we were pretty busy getting the 10.x release out.
Thanks for providing a test app @edee111, this made it very easy to look into this!
I think this PR is the appropriate fix: #2102, can you please review?
It would still fail your test but I think that's correct. The point is that we shouldn't re-introduce values from normal configuration if this was overridden in a test property source, but it should still add excluded for the autoconfigs we don't want from Spring GraphQL. Your test didn't account for that, but I think that's the correctbehavior?
I wanted to upgrade DGS to the latest version
9.1.2
. So I changed the dependency in Gradle:com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:8.5.8
com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:9.1.2
But then when starting an application there is a deprecation warning in the log
But when changing the dependency to
com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter:9.1.2
, some unit tests stopped working. See the details bellow.Expected behavior
When overriding the Spring Boot (SB) property
spring.autoconfigure.exclude
e.g. in a unit test by the@TestProperties
annotation, the value set in the annotation should be present in the application context.Actual behavior
Setting the
spring.autoconfigure.exclude
e.g. in unit test by the@TestProperties
appends the value to the configuration property already defined e.g. inapplication.yaml
file. Does not override it.Steps to reproduce
In this repository, the issue is reproduced.
Experiments in the repository show that:
com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter
com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter
More info
I checked the commits between those two versions, and it seems that the cause of this new behavior could be the class
com.netflix.graphql.dgs.springgraphql.autoconfig.ExcludeAutoConfigurationsEnvironmentPostProcessor
. It manipulates thespring.autoconfigure.exclude
property in some way. Also, this class is not present incom.netflix.graphql.dgs:graphql-dgs-spring-boot-starter
but is present incom.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter
which also supports my assumption.In my project, I need to exclude some autoconfiguration for all unit tests, but in some cases, I want to keep it included and that is why I changed the
spring.autoconfigure.exclude
just for a few tests out of thousands.The text was updated successfully, but these errors were encountered: