Tomcat is started with a vm argument: -Dserver.ref=test. The value of this argument determines what type of properties file is to be read by the application. Unit tests also depend on the value of this property and need to match what is set in Tomcat.
I think I just need to set this property myself within the unit test ? I don’t think there a mechanism to check what the value -Dserver.ref is within Tomcat ?

This should work:
refshould be equal to"test".