SolaceJmsAutoCloudConfiguration extends SolaceJmsAutoConfigurationBase { @Override public List<SolaceServiceCredentials> getSolaceServiceCredentials() { return new ArrayList<SolaceServiceCredentials>(getSolaceMessagingInfos()); } @Autowired  SolaceJmsAutoCloudConfiguration(SolaceJmsProperties properties); @Deprecated @Bean @Primary SolaceMessagingInfo findFirstSolaceMessagingInfo(); @Override List<SolaceServiceCredentials> getSolaceServiceCredentials(); @Deprecated @Override List<SolaceMessagingInfo> getSolaceMessagingInfos();  }
@Test public void hasBeanIsCloudHasService() throws NoSuchBeanDefinitionException { makeCloudEnv(); String JSONString = addOneSolaceService("VCAP_SERVICES"); String CF_VCAP_SERVICES = "VCAP_SERVICES={ \"solace-pubsub\": [" + JSONString + "] }"; load(CF_CLOUD_APP_ENV, CF_VCAP_SERVICES); Environment env = context.getEnvironment(); String VCAP_APPLICATION = env.getProperty("VCAP_APPLICATION"); assertNotNull(VCAP_APPLICATION); assertEquals("{}", VCAP_APPLICATION); String VCAP_SERVICES = env.getProperty("VCAP_SERVICES"); assertNotNull(VCAP_SERVICES); assertTrue(VCAP_SERVICES.contains("solace-pubsub")); validateBackwardsCompatibility(); T bean = this.context.getBean(beanClass); assertNotNull(bean); if (beanClass.equals(SpringSolJmsConnectionFactoryCloudFactory.class)) { SpringSolJmsConnectionFactoryCloudFactory springSolConnectionFactoryCloudFactory = (SpringSolJmsConnectionFactoryCloudFactory) bean; assertNotNull(springSolConnectionFactoryCloudFactory.getSolConnectionFactory()); List<SolaceServiceCredentials> availableServices = springSolConnectionFactoryCloudFactory .getSolaceServiceCredentials(); assertNotNull(availableServices); assertEquals(1,availableServices.size()); } }
@Test public void isCloudConfiguredByUserProvidedServices() { makeCloudEnv(); String JSONString = addOneUserProvidedSolaceService("VCAP_SERVICES"); String CF_VCAP_SERVICES = "VCAP_SERVICES={ \"user-provided\": [" + JSONString + "] }"; load(CF_CLOUD_APP_ENV, CF_VCAP_SERVICES); Environment env = context.getEnvironment(); String VCAP_APPLICATION = env.getProperty("VCAP_APPLICATION"); assertNotNull(VCAP_APPLICATION); assertEquals("{}", VCAP_APPLICATION); String VCAP_SERVICES = env.getProperty("VCAP_SERVICES"); assertNotNull(VCAP_SERVICES); assertTrue(VCAP_SERVICES.contains("solace-pubsub")); validateBackwardsCompatibility(); T bean = this.context.getBean(beanClass); assertNotNull(bean); if (beanClass.equals(SpringSolJmsConnectionFactoryCloudFactory.class)) { SpringSolJmsConnectionFactoryCloudFactory springSolConnectionFactoryCloudFactory = (SpringSolJmsConnectionFactoryCloudFactory) bean; assertNotNull(springSolConnectionFactoryCloudFactory.getSolConnectionFactory()); List<SolaceServiceCredentials> availableServices = springSolConnectionFactoryCloudFactory .getSolaceServiceCredentials(); assertNotNull(availableServices); assertEquals(1, availableServices.size()); } }