Example #1
0
  @Test
  public void removing_plugins_are_sorted_and_unique() throws Exception {
    when(serverPluginRepository.getUninstalledPlugins())
        .thenReturn(
            of(
                newPluginInfo(0).setName("Foo"),
                newPluginInfo(3).setName("Bar"),
                newPluginInfo(2).setName("Bar")));

    underTest.handle(request, response);

    assertJson(response.outputAsString())
        .withStrictArrayOrder()
        .isSimilarTo(
            "{"
                + "  \"installing\": [],"
                + "  \"removing\": "
                + "  ["
                + "    {"
                + "      \"key\": \"key2\","
                + "      \"name\": \"Bar\","
                + "    },"
                + "    {"
                + "      \"key\": \"key3\","
                + "      \"name\": \"Bar\","
                + "    },"
                + "    {"
                + "      \"key\": \"key0\","
                + "      \"name\": \"Foo\","
                + "    }"
                + "  ]"
                + "}");
  }
Example #2
0
  @Test
  public void verify_properties_displayed_in_json_per_removing_plugin() throws Exception {
    when(serverPluginRepository.getUninstalledPlugins()).thenReturn(of(gitPluginInfo()));

    underTest.handle(request, response);

    assertJson(response.outputAsString())
        .isSimilarTo(
            "{"
                + "  \"installing\": [],"
                + "  \"removing\": "
                + "  ["
                + "    {"
                + "      \"key\": \"scmgit\","
                + "      \"name\": \"Git\","
                + "      \"description\": \"Git SCM Provider.\","
                + "      \"version\": \"1.0\","
                + "      \"license\": \"GNU LGPL 3\","
                + "      \"organizationName\": \"SonarSource\","
                + "      \"organizationUrl\": \"http://www.sonarsource.com\","
                + "      \"homepageUrl\": \"http://redirect.sonarsource.com/plugins/scmgit.html\","
                + "      \"issueTrackerUrl\": \"http://jira.sonarsource.com/browse/SONARSCGIT\","
                + "      \"implementationBuild\": \"9ce9d330c313c296fab051317cc5ad4b26319e07\""
                + "    }"
                + "  ]"
                + "}");
  }