forked from jqassistant-archive/jqa-spring-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Applying the spring-boot:Strict group gives a constraint violation when injecting jdk classes.
The constraint JdkClassesMustNotBeInjectables seems overly strict because injecting a java.time.Clock is a valuable solution to set a fixed time in tests.
I assume the rule is valid only when there is no custom bean configuration available for the jdk type in use.
For instance, this is our clock-bean-configuration
@Configuration
class ClockConfiguration {
@Bean
fun clock(): Clock {
return Clock.systemDefaultZone()
}
@Bean
// needed for Hibernate Validators
fun clockProvider(): ClockProvider {
// ClockProvider only has one Method -> SAM-Type (Single-Abstract-Method)
return ClockProvider { clock() }
}
}
According this old post, it is not possible to exclude single rules. Is this still the case?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels