Tabnine Logo
PackageMaterialMetadataLoader.fetchRepositoryAndPackageMetaData
Code IndexAdd Tabnine to your IDE (free)

How to use
fetchRepositoryAndPackageMetaData
method
in
com.thoughtworks.go.plugin.access.packagematerial.PackageMaterialMetadataLoader

Best Java code snippets using com.thoughtworks.go.plugin.access.packagematerial.PackageMaterialMetadataLoader.fetchRepositoryAndPackageMetaData (Showing top 6 results out of 315)

origin: gocd/gocd

@Override
public void pluginLoaded(GoPluginDescriptor pluginDescriptor) {
  if (packageRepositoryExtension.canHandlePlugin(pluginDescriptor.id())) {
    fetchRepositoryAndPackageMetaData(pluginDescriptor);
  }
}
origin: gocd/gocd

@Test
public void shouldFetchMetadataOnPluginLoadedCallback() throws Exception {
  PackageMaterialMetadataLoader spy = spy(metadataLoader);
  doNothing().when(spy).fetchRepositoryAndPackageMetaData(pluginDescriptor);
  when(packageRepositoryExtension.canHandlePlugin(pluginDescriptor.id())).thenReturn(true);
  spy.pluginLoaded(pluginDescriptor);
  verify(spy).fetchRepositoryAndPackageMetaData(pluginDescriptor);
}
origin: gocd/gocd

@Test
public void shouldNotTryToFetchMetadataOnPluginLoadedCallback() throws Exception {
  PackageMaterialMetadataLoader spy = spy(metadataLoader);
  when(packageRepositoryExtension.canHandlePlugin(pluginDescriptor.id())).thenReturn(false);
  spy.pluginLoaded(pluginDescriptor);
  verify(spy, never()).fetchRepositoryAndPackageMetaData(pluginDescriptor);
}
origin: gocd/gocd

@Test
public void shouldThrowExceptionWhenNullRepositoryConfigurationReturned() {
  when(packageRepositoryExtension.getRepositoryConfiguration(pluginDescriptor.id())).thenReturn(null);
  try {
    metadataLoader.fetchRepositoryAndPackageMetaData(pluginDescriptor);
  } catch (Exception e) {
    assertThat(e.getMessage(), is("Plugin[plugin-id] returned null repository configuration"));
  }
  assertThat(RepositoryMetadataStore.getInstance().getMetadata(pluginDescriptor.id()), nullValue());
  assertThat(PackageMetadataStore.getInstance().getMetadata(pluginDescriptor.id()), nullValue());
}
origin: gocd/gocd

@Test
public void shouldThrowExceptionWhenNullPackageConfigurationReturned() {
  when(packageRepositoryExtension.getPackageConfiguration(pluginDescriptor.id())).thenReturn(null);
  try {
    metadataLoader.fetchRepositoryAndPackageMetaData(pluginDescriptor);
  } catch (Exception e) {
    assertThat(e.getMessage(), is("Plugin[plugin-id] returned null repository configuration"));
  }
  assertThat(RepositoryMetadataStore.getInstance().getMetadata(pluginDescriptor.id()), nullValue());
  assertThat(PackageMetadataStore.getInstance().getMetadata(pluginDescriptor.id()), nullValue());
}
origin: gocd/gocd

@Test
public void shouldFetchPackageMetadataForPluginsWhichImplementPackageRepositoryMaterialExtensionPoint() {
  RepositoryConfiguration expectedRepoConfigurations = new RepositoryConfiguration();
  com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration expectedPackageConfigurations = new PackageConfiguration();
  when(packageRepositoryExtension.getRepositoryConfiguration(pluginDescriptor.id())).thenReturn(expectedRepoConfigurations);
  when(packageRepositoryExtension.getPackageConfiguration(pluginDescriptor.id())).thenReturn(expectedPackageConfigurations);
  metadataLoader.fetchRepositoryAndPackageMetaData(pluginDescriptor);
  assertThat(RepositoryMetadataStore.getInstance().getMetadata(pluginDescriptor.id()).getRepositoryConfiguration(), is(expectedRepoConfigurations));
  assertThat(PackageMetadataStore.getInstance().getMetadata(pluginDescriptor.id()).getPackageConfiguration(), is(expectedPackageConfigurations));
}
com.thoughtworks.go.plugin.access.packagematerialPackageMaterialMetadataLoaderfetchRepositoryAndPackageMetaData

Popular methods of PackageMaterialMetadataLoader

  • <init>
  • pluginLoaded
  • pluginUnLoaded

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JLabel (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now