@Autowired
private AcrossContextInfo contextInfo;
@Test
public void checkPropertiesSet() {
SetPropertyConfig config = contextBeanRegistry.getBeanOfTypeFromModule( "onlyFromContext",
SetPropertyConfig.class );
assertNotNull( config );
assertEquals( "acrossContext", config.contextValue );
assertEquals( "acrossContext", config.moduleSourceValue );
assertEquals( "acrossContext", config.moduleDirectValue );
assertEquals( 777, config.contextDirectValue );
assertEquals( 50, config.unresolvable );
assertEquals( "acrossContext", config.getProperty( "contextValue" ) );
assertEquals( "acrossContext", config.getProperty( "moduleSourceValue" ) );
assertEquals( "acrossContext", config.getProperty( "moduleDirectValue" ) );
assertEquals( new Integer( 777 ), config.getProperty( "contextDirectValue", Integer.class ) );
config = contextBeanRegistry.getBeanOfTypeFromModule( "sourceOnModule", SetPropertyConfig.class );
assertNotNull( config );
assertEquals( "acrossContext", config.contextValue );
assertEquals( "acrossModule", config.moduleSourceValue );
assertEquals( "acrossModule", config.moduleDirectValue );
assertEquals( 777, config.contextDirectValue );
assertEquals( 50, config.unresolvable );
assertEquals( "acrossContext", config.getProperty( "contextValue" ) );
assertEquals( "acrossModule", config.getProperty( "moduleSourceValue" ) );
assertEquals( "acrossModule", config.getProperty( "moduleDirectValue" ) );
assertEquals( new Integer( 777 ), config.getProperty( "contextDirectValue", Integer.class ) );
config = contextBeanRegistry.getBeanOfTypeFromModule( "directOnModule", SetPropertyConfig.class );
assertNotNull( config );
assertEquals( "acrossContext", config.contextValue );
assertEquals( "acrossModule", config.moduleSourceValue );
assertEquals( "directValue", config.moduleDirectValue );
assertEquals( 777, config.contextDirectValue );
assertEquals( 100, config.unresolvable );
assertEquals( "acrossContext", config.getProperty( "contextValue" ) );
assertEquals( "acrossModule", config.getProperty( "moduleSourceValue" ) );
assertEquals( "directValue", config.getProperty( "moduleDirectValue" ) );
assertEquals( new Integer( 777 ), config.getProperty( "contextDirectValue", Integer.class ) );
assertEquals( "default", config.getProperty( "defaultOnlyValue" ) );
assertEquals( "applicationContext", config.getProperty( "parentContextValue" ) );
}