diff --git a/src/main/java/se/bjurr/prnfb/ManualResource.java b/src/main/java/se/bjurr/prnfb/ManualResource.java index 5e1920f4..3990329d 100644 --- a/src/main/java/se/bjurr/prnfb/ManualResource.java +++ b/src/main/java/se/bjurr/prnfb/ManualResource.java @@ -3,6 +3,7 @@ import static com.atlassian.bitbucket.permission.Permission.ADMIN; import static com.google.common.collect.Iterables.find; import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Ordering.usingToString; import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; @@ -106,6 +107,7 @@ && triggeredByAction(clientKeyStore, settings, pullRequestAction, pullRequest, v buttons.add(candidate); } } + buttons = usingToString().sortedCopy(buttons); return ok(gson.toJson(buttons), APPLICATION_JSON).build(); } diff --git a/src/main/java/se/bjurr/prnfb/settings/PrnfbButton.java b/src/main/java/se/bjurr/prnfb/settings/PrnfbButton.java index afa80afa..9f4f0074 100644 --- a/src/main/java/se/bjurr/prnfb/settings/PrnfbButton.java +++ b/src/main/java/se/bjurr/prnfb/settings/PrnfbButton.java @@ -25,4 +25,9 @@ public BUTTON_VISIBILITY getVisibility() { public String getFormIdentifier() { return formIdentifier; } + + @Override + public String toString() { + return "Title: " + title; + } }