@Test
public void sortedPlugins() {

    // create incomplete plugin descriptor (ignore some attributes)
    PluginDescriptor pd1 = new DefaultPluginDescriptor()
        .setPluginId("p1")
        .setDependencies("p2");
    PluginDescriptor pd2 = new DefaultPluginDescriptor()
        .setPluginId("p2")
        .setPluginVersion("0.0.0"); // needed in "checkDependencyVersion" method
    List<PluginDescriptor> plugins = new ArrayList<>();
    plugins.add(pd1);
    plugins.add(pd2);
    DependencyResolver.Result result = resolver.resolve(plugins);
    assertTrue(result.getNotFoundDependencies().isEmpty());
    assertEquals(result.getSortedPlugins(), Arrays.asList("p2", "p1"));
}