DisabledFeatureComponent implements IsElement { public void show(String featureId) { ExperimentalFeatureDefinition feature = defRegistry.getFeatureById(featureId); PortablePreconditions.checkNotNull("experimentalFeature", feature); String featureName = Optional.ofNullable(translationService.getTranslation(feature.getNameKey())).orElse(featureId); String text; if (feature.isGlobal()) { text = translationService.format(UberfireExperimentalConstants.disabledGlobalExperimentalFeature, featureName); } else { text = translationService.format(UberfireExperimentalConstants.disabledExperimentalFeature, featureName); } view.show(text); } @Inject  DisabledFeatureComponent(DisabledFeatureComponentView view, ExperimentalFeatureDefRegistry defRegistry, TranslationService translationService); @Override HTMLElement getElement(); void show(String featureId);  }
@Test public void testShowMissingExperimentalFeature() { Assertions.assertThatThrownBy(() -> component.show(EXPERIMENTAL_FEATURE_ID)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Parameter named 'experimentalFeature' should be not null!"); verify(translationService, never()).getTranslation(anyString()); verify(translationService, never()).format(anyString(), anyString()); verify(view, never()).show(anyString()); }