mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
update CHANGELOG.md
This commit is contained in:
@@ -36,8 +36,6 @@ import sonia.scm.repository.RepositoryTestData;
|
||||
import java.net.URI;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import com.github.sdorra.shiro.ShiroRule;
|
||||
@@ -166,7 +166,7 @@ public class IndexResourceTest {
|
||||
|
||||
Assertions.assertThat(index.getLinks().getLinksBy("autocomplete"))
|
||||
.extracting("name")
|
||||
.doesNotContainSequence("users", "groups");
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -227,7 +227,7 @@ class DefaultPluginManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldNotInstallAlreadyInstalledDependencies() {
|
||||
void shouldNotInstallAlreadyInstalledDependenciesWhenUpToDate() {
|
||||
AvailablePlugin review = createAvailable("scm-review-plugin");
|
||||
when(review.getDescriptor().getDependencies()).thenReturn(ImmutableSet.of("scm-mail-plugin"));
|
||||
AvailablePlugin mail = createAvailable("scm-mail-plugin");
|
||||
@@ -244,6 +244,22 @@ class DefaultPluginManagerTest {
|
||||
assertThat(captor.getValue().getDescriptor().getInformation().getName()).isEqualTo("scm-review-plugin");
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldUpdateAlreadyInstalledDependenciesWhenNewerVersionIsAvailable() {
|
||||
AvailablePlugin review = createAvailable("scm-review-plugin");
|
||||
when(review.getDescriptor().getDependencies()).thenReturn(ImmutableSet.of("scm-mail-plugin"));
|
||||
AvailablePlugin mail = createAvailable("scm-mail-plugin", "1.1.0");
|
||||
when(center.getAvailable()).thenReturn(ImmutableSet.of(review, mail));
|
||||
|
||||
InstalledPlugin installedMail = createInstalled("scm-mail-plugin", "1.0.0");
|
||||
when(loader.getInstalledPlugins()).thenReturn(ImmutableList.of(installedMail));
|
||||
|
||||
manager.install("scm-review-plugin", false);
|
||||
|
||||
verify(installer).install(mail);
|
||||
verify(installer).install(review);
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldRollbackOnFailedInstallation() {
|
||||
AvailablePlugin review = createAvailable("scm-review-plugin");
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.plugin;
|
||||
|
||||
import org.mockito.Answers;
|
||||
@@ -32,10 +32,7 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
public class PluginTestHelper {
|
||||
public static AvailablePlugin createAvailable(String name) {
|
||||
PluginInformation information = new PluginInformation();
|
||||
information.setName(name);
|
||||
information.setVersion("1.0");
|
||||
return createAvailable(information);
|
||||
return createAvailable(name, "1.0");
|
||||
}
|
||||
|
||||
public static AvailablePlugin createAvailable(String name, String version) {
|
||||
@@ -46,9 +43,13 @@ public class PluginTestHelper {
|
||||
}
|
||||
|
||||
public static InstalledPlugin createInstalled(String name) {
|
||||
return createInstalled(name, "1.0");
|
||||
}
|
||||
|
||||
public static InstalledPlugin createInstalled(String name, String version) {
|
||||
PluginInformation information = new PluginInformation();
|
||||
information.setName(name);
|
||||
information.setVersion("1.0");
|
||||
information.setVersion(version);
|
||||
return createInstalled(information);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user