@Test public void getConnectorDefaultWithNoDefault() { List<CloudConnector> connectorList = Lists.newArrayList(); connectorList.add(getConnector("NODEFAULT", "ONE")); connectorList.add(getConnector("NODEFAULT", "TWO")); ReflectionTestUtils.setField(c, "cloudConnectors", connectorList); thrown.expect(IllegalStateException.class); thrown.expectMessage(is("No default variant is specified for platform: 'StringType{value='NODEFAULT'}'")); c.cloudPlatformConnectors(); }
@PostConstruct public void cloudPlatformConnectors() { platformToVariants = HashMultimap.create(); cloudConnectors.forEach(connector -> { map.put(new CloudPlatformVariant(connector.platform(), connector.variant()), connector); platformToVariants.put(connector.platform(), connector.variant()); }); Map<Platform, Variant> environmentDefaults = extractEnvironmentDefaultVariants(); setupDefaultVariants(platformToVariants, environmentDefaults); LOGGER.debug(map.toString()); LOGGER.debug(defaultVariants.toString()); }
CloudPlatformConnectors { @PostConstruct public void cloudPlatformConnectors() { platformToVariants = HashMultimap.create(); cloudConnectors.forEach(connector -> { map.put(new CloudPlatformVariant(connector.platform(), connector.variant()), connector); platformToVariants.put(connector.platform(), connector.variant()); }); Map<Platform, Variant> environmentDefaults = extractEnvironmentDefaultVariants(); setupDefaultVariants(platformToVariants, environmentDefaults); LOGGER.debug(map.toString()); LOGGER.debug(defaultVariants.toString()); } }
CloudPlatformConnectors { @PostConstruct public void cloudPlatformConnectors() { platformToVariants = HashMultimap.create(); cloudConnectors.forEach(connector -> { map.put(new CloudPlatformVariant(connector.platform(), connector.variant()), connector); platformToVariants.put(connector.platform(), connector.variant()); }); Map<Platform, Variant> environmentDefaults = extractEnvironmentDefaultVariants(); setupDefaultVariants(platformToVariants, environmentDefaults); LOGGER.debug(map.toString()); LOGGER.debug(defaultVariants.toString()); }  }
CloudPlatformConnectors { @PostConstruct public void cloudPlatformConnectors() { platformToVariants = HashMultimap.create(); cloudConnectors.forEach(connector -> { map.put(new CloudPlatformVariant(connector.platform(), connector.variant()), connector); platformToVariants.put(connector.platform(), connector.variant()); }); Map<Platform, Variant> environmentDefaults = extractEnvironmentDefaultVariants(); setupDefaultVariants(platformToVariants, environmentDefaults); LOGGER.debug(map.toString()); LOGGER.debug(defaultVariants.toString()); }  @PostConstruct void cloudPlatformConnectors(); Variant getDefaultVariant(Platform platform); CloudConnector<Object> getDefault(Platform platform); CloudConnector<Object> get(Platform platform, Variant variant); CloudConnector<Object> get(CloudPlatformVariant variant); PlatformVariants getPlatformVariants(); }
CloudPlatformConnectors { @PostConstruct public void cloudPlatformConnectors() { platformToVariants = HashMultimap.create(); cloudConnectors.forEach(connector -> { map.put(new CloudPlatformVariant(connector.platform(), connector.variant()), connector); platformToVariants.put(connector.platform(), connector.variant()); }); Map<Platform, Variant> environmentDefaults = extractEnvironmentDefaultVariants(); setupDefaultVariants(platformToVariants, environmentDefaults); LOGGER.debug(map.toString()); LOGGER.debug(defaultVariants.toString()); }  @PostConstruct void cloudPlatformConnectors(); Variant getDefaultVariant(Platform platform); CloudConnector<Object> getDefault(Platform platform); CloudConnector<Object> get(Platform platform, Variant variant); CloudConnector<Object> get(CloudPlatformVariant variant); PlatformVariants getPlatformVariants();  }