Skip to content

aleskiewicz/spring-profiles-operators-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-profiles-operators-test

Possible bug in handling profiles info in Spring 5.1

ProfilesTest contains several tests for the following combination of @Profiles values and active profiles:

@Profile value Active profiles Test name Expected result Actual result
!a & b b notAandBShouldAcceptWhenBActive true true
b & !a b bAndNotAShouldAcceptWhenBActive true true
!a & b a notAandBShouldNotAcceptWhenAActive false true
b & !a a bAndNotAShouldNotAcceptWhenAActive false false
!a & b ab notAandBShouldNotAcceptWhenABActive false false
b & !a ab bAndNotAShouldNotAcceptWhenABActive false false

As shown in the table above, test notAandBShouldNotAcceptWhenAActive should not accept the bean, but it does, and just different order of operations in @Profile is enough to behave accordingly. Tests were performed on JDK8

About

Possible bug in handling profiles info in Spring 5.1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages