mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
add tests
This commit is contained in:
@@ -27,13 +27,11 @@ import static sonia.scm.NotFoundException.notFound;
|
||||
public class AvailablePluginResource {
|
||||
|
||||
private final PluginDtoCollectionMapper collectionMapper;
|
||||
private PluginDtoMapper dtoMapper;
|
||||
private final PluginManager pluginManager;
|
||||
|
||||
@Inject
|
||||
public AvailablePluginResource(PluginDtoCollectionMapper collectionMapper, PluginDtoMapper dtoMapper, PluginManager pluginManager) {
|
||||
public AvailablePluginResource(PluginDtoCollectionMapper collectionMapper, PluginManager pluginManager) {
|
||||
this.collectionMapper = collectionMapper;
|
||||
this.dtoMapper = dtoMapper;
|
||||
this.pluginManager = pluginManager;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package sonia.scm.plugin;
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
@@ -24,7 +26,7 @@ public final class PluginCenterDto implements Serializable {
|
||||
|
||||
@XmlRootElement(name = "_embedded")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
static class Embedded {
|
||||
public static class Embedded {
|
||||
|
||||
@XmlElement(name = "plugins")
|
||||
private List<Plugin> plugins;
|
||||
@@ -40,7 +42,8 @@ public final class PluginCenterDto implements Serializable {
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "plugins")
|
||||
@Getter
|
||||
static class Plugin {
|
||||
@AllArgsConstructor
|
||||
public static class Plugin {
|
||||
|
||||
private String name;
|
||||
private String displayName;
|
||||
@@ -63,7 +66,8 @@ public final class PluginCenterDto implements Serializable {
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "conditions")
|
||||
@Getter
|
||||
static class Condition {
|
||||
@AllArgsConstructor
|
||||
public static class Condition {
|
||||
|
||||
private String os;
|
||||
private String arch;
|
||||
@@ -73,6 +77,7 @@ public final class PluginCenterDto implements Serializable {
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "dependencies")
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
static class Dependency {
|
||||
private String name;
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
package sonia.scm.plugin;
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import sonia.scm.plugin.PluginCondition;
|
||||
import sonia.scm.plugin.PluginInformation;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -46,6 +46,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.SCMContextProvider;
|
||||
import sonia.scm.api.v2.resources.PluginCenterDto;
|
||||
import sonia.scm.cache.Cache;
|
||||
import sonia.scm.cache.CacheManager;
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
@@ -67,21 +68,18 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.xml.bind.JAXB;
|
||||
|
||||
import sonia.scm.net.ahc.AdvancedHttpClient;
|
||||
|
||||
import static sonia.scm.plugin.PluginCenterDtoMapper.*;
|
||||
import static sonia.scm.api.v2.resources.PluginCenterDtoMapper.*;
|
||||
|
||||
/**
|
||||
* TODO replace aether stuff.
|
||||
|
||||
Reference in New Issue
Block a user