mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
pushFailsOnInvalidProject integration test.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -18,6 +20,13 @@ public class SnapshotPostbackRequestInvalidProject extends SnapshotPostbackReque
|
||||
this.errors = errors;
|
||||
}
|
||||
|
||||
public SnapshotPostbackRequestInvalidProject(JsonArray errors) {
|
||||
this(new ArrayList<String>());
|
||||
for (JsonElement error : errors) {
|
||||
this.errors.add(error.getAsString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject toJson() {
|
||||
JsonObject jsonThis = super.toJson();
|
||||
|
||||
@@ -140,7 +140,7 @@ public class SnapshotAPIStateBuilder {
|
||||
} else if (type.equals("invalidFiles")) {
|
||||
p = new SnapshotPostbackRequestInvalidFiles(jsonPostback.get("errors").getAsJsonArray());
|
||||
} else if (type.equals("invalidProject")) {
|
||||
p = new SnapshotPostbackRequestInvalidProject(new LinkedList<String>());
|
||||
p = new SnapshotPostbackRequestInvalidProject(jsonPostback.get("errors").getAsJsonArray());
|
||||
} else if (type.equals("error")) {
|
||||
p = new SnapshotPostbackRequestError();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user