@Test public void getComponentMappingsThrowExIfNoHost() { try { app.createAndManageChild(createDummyExtraServiceSpec(null, null, ImmutableList.of("MY_COMPONENT"))).getComponentMappings(); fail(); } catch (Throwable throwable) { Throwable rootCause = ExceptionUtils.getRootCause(throwable); assertEquals(NullPointerException.class, rootCause.getClass()); assertEquals("Default host is required", rootCause.getMessage()); } }
@Override @Nonnull public List<ComponentMapping> getComponentMappings() { if (componentMappings == null) { componentMappings = MutableList.of(); if (getConfig(COMPONENT_NAMES) != null) { for (String mapping : getConfig(COMPONENT_NAMES)) { componentMappings.add(new ComponentMapping(mapping, getConfig(BIND_TO))); } } } return componentMappings; }
AbstractExtraService extends BasicStartableImpl implements ExtraService { @Override @Nonnull public List<ComponentMapping> getComponentMappings() { if (componentMappings == null) { componentMappings = MutableList.of(); if (getConfig(COMPONENT_NAMES) != null) { for (String mapping : getConfig(COMPONENT_NAMES)) { componentMappings.add(new ComponentMapping(mapping, getConfig(BIND_TO))); } } } return componentMappings; } }
AbstractExtraService extends BasicStartableImpl implements ExtraService { @Override @Nonnull public List<ComponentMapping> getComponentMappings() { if (componentMappings == null) { componentMappings = MutableList.of(); if (getConfig(COMPONENT_NAMES) != null) { for (String mapping : getConfig(COMPONENT_NAMES)) { componentMappings.add(new ComponentMapping(mapping, getConfig(BIND_TO))); } } } return componentMappings; }  }
AbstractExtraService extends BasicStartableImpl implements ExtraService { @Override @Nonnull public List<ComponentMapping> getComponentMappings() { if (componentMappings == null) { componentMappings = MutableList.of(); if (getConfig(COMPONENT_NAMES) != null) { for (String mapping : getConfig(COMPONENT_NAMES)) { componentMappings.add(new ComponentMapping(mapping, getConfig(BIND_TO))); } } } return componentMappings; }  @Override @Deprecated Map<String, Map> getAmbariConfig(); @Override Map<String, Map> getAmbariConfig(AmbariCluster ambariCluster); @Override @Nonnull List<ComponentMapping> getComponentMappings(); }
AbstractExtraService extends BasicStartableImpl implements ExtraService { @Override @Nonnull public List<ComponentMapping> getComponentMappings() { if (componentMappings == null) { componentMappings = MutableList.of(); if (getConfig(COMPONENT_NAMES) != null) { for (String mapping : getConfig(COMPONENT_NAMES)) { componentMappings.add(new ComponentMapping(mapping, getConfig(BIND_TO))); } } } return componentMappings; }  @Override @Deprecated Map<String, Map> getAmbariConfig(); @Override Map<String, Map> getAmbariConfig(AmbariCluster ambariCluster); @Override @Nonnull List<ComponentMapping> getComponentMappings();  }