Esempio n. 1
0
  @Test
  public void if_plugin_has_an_update_download_is_triggered_with_latest_version_from_updatecenter()
      throws Exception {
    Version version = Version.create("1.0");
    when(updateCenter.findPluginUpdates())
        .thenReturn(
            ImmutableList.of(
                PluginUpdate.createWithStatus(
                    new Release(new Plugin(PLUGIN_KEY), version), Status.COMPATIBLE)));

    underTest.handle(validRequest, response);

    verify(pluginDownloader).download(PLUGIN_KEY, version);
    assertThat(response.outputAsString()).isEmpty();
  }
 private static PluginUpdate createPluginUpdate(Plugin plugin) {
   return PluginUpdate.createWithStatus(new Release(plugin, SOME_VERSION), SOME_STATUS);
 }