use of org.sonar.core.platform.ComponentContainer in project sonarqube by SonarSource.
the class ExtensionInstallerTest method should_execute_extension_provider.
@Test
public void should_execute_extension_provider() {
when(pluginRepository.getPluginInfos()).thenReturn(Arrays.asList(new PluginInfo("foo")));
when(pluginRepository.getPluginInstance("foo")).thenReturn(newPluginInstance(new FooProvider(), new BarProvider()));
ComponentContainer container = new ComponentContainer();
ExtensionInstaller installer = new ExtensionInstaller(mock(SonarRuntime.class), pluginRepository, mock(AnalysisMode.class));
installer.install(container, new FooMatcher());
assertThat(container.getComponentByType(Foo.class)).isNotNull();
assertThat(container.getComponentByType(Bar.class)).isNull();
}
Aggregations