Skip to content

Commit 4c09977

Browse files
authored
archived false (#660)
1 parent 96d9025 commit 4c09977

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/main/java/org/openstreetmap/atlas/checks/maproulette/data/Challenge.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class Challenge implements Serializable
3838
public static final String KEY_TAGS = "tags";
3939
public static final String DEFAULT_CHECKIN_COMMENT = "#maproulette";
4040
public static final String DISCOVERABLE = "enabled";
41+
public static final String IS_ARCHIVED = "isArchived";
4142

4243
private static final long serialVersionUID = -8034692909431083341L;
4344
private static final Gson CHALLENGE_GSON = new GsonBuilder().disableHtmlEscaping()
@@ -64,6 +65,7 @@ public class Challenge implements Serializable
6465
private String checkName;
6566
private boolean purge;
6667
private boolean changesetUrl = false;
68+
private boolean isArchived = false;
6769

6870
public Challenge(final Challenge challenge)
6971
{
@@ -194,6 +196,11 @@ public String getTags()
194196
return this.tags;
195197
}
196198

199+
public boolean isArchived()
200+
{
201+
return this.isArchived;
202+
}
203+
197204
public boolean isEnabled()
198205
{
199206
return this.enabled;
@@ -261,6 +268,7 @@ public JsonObject toJson(final String challengeName)
261268
challengeJson.add(KEY_ACTIVE, new JsonPrimitive(true));
262269
challengeJson.add(KEY_UPDATE_TASKS, new JsonPrimitive(this.updateTasks));
263270
challengeJson.add(DISCOVERABLE, new JsonPrimitive(this.enabled));
271+
challengeJson.add(IS_ARCHIVED, new JsonPrimitive(this.isArchived));
264272

265273
// Do not override the name if it's already set
266274
if (this.name.isEmpty())

src/test/java/org/openstreetmap/atlas/checks/maproulette/data/ChallengeSerializationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public void serializationTest()
9292
Assert.assertNotNull(deserializedChallenge.getHighPriorityRule());
9393
Assert.assertNotNull(deserializedChallenge.getMediumPriorityRule());
9494
Assert.assertNull(deserializedChallenge.getLowPriorityRule());
95+
Assert.assertFalse(deserializedChallenge.isArchived());
9596
}
9697

9798
/**

0 commit comments

Comments
 (0)