Merge pull request #2223 from ssilvert/partial-import-tests
KEYCLOAK-2481: Create admin client endpoint for partial import + tests
This commit is contained in:
commit
5df540df8c
5 files changed
+517
-10
No files matched your search
@@ -26,11 +26,13 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
*/
|
||||
public class PartialImportResult {
|
||||
|
||||
private final Action action;
|
||||
private final ResourceType resourceType;
|
||||
private final String resourceName;
|
||||
private final String id;
|
||||
private final Object representation;
|
||||
private Action action;
|
||||
private ResourceType resourceType;
|
||||
private String resourceName;
|
||||
private String id;
|
||||
private Object representation;
|
||||
|
||||
private PartialImportResult() {};
|
||||
|
||||
private PartialImportResult(Action action, ResourceType resourceType, String resourceName, String id, Object representation) {
|
||||
this.action = action;
|
||||
@@ -56,18 +58,34 @@ public class PartialImportResult {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(Action action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public ResourceType getResourceType() {
|
||||
return resourceType;
|
||||
}
|
||||
|
||||
public void setResourceType(ResourceType resourceType) {
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public String getResourceName() {
|
||||
return resourceName;
|
||||
}
|
||||
|
||||
public void setResourceName(String resourceName) {
|
||||
this.resourceName = resourceName;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Object getRepresentation() {
|
||||
return representation;
|
||||
|
||||
@@ -28,6 +28,14 @@ import java.util.Set;
|
||||
*/
|
||||
public class PartialImportResults {
|
||||
|
||||
// these fields used only for marsalling from JSON with admin client
|
||||
// they are never directly set
|
||||
private int overwritten;
|
||||
private int added;
|
||||
private int skipped;
|
||||
|
||||
private String errorMessage;
|
||||
|
||||
private final Set<PartialImportResult> importResults = new HashSet<>();
|
||||
|
||||
public void addResult(PartialImportResult result) {
|
||||
@@ -68,4 +76,13 @@ public class PartialImportResults {
|
||||
public Set<PartialImportResult> getResults() {
|
||||
return importResults;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user