CodeOwnersOnPostReviewIT: Fix test
If voting on multiple labels is done at the same time, the order in
which the labels appear in the change message is not guaranteed.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: If70525a7f8fb823028e7832babff045c67219cc8
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnPostReviewIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnPostReviewIT.java
index 6debe05..9bae548 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnPostReviewIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnPostReviewIT.java
@@ -34,6 +34,7 @@
import com.google.inject.Inject;
import java.util.Collection;
import java.util.HashMap;
+import java.util.regex.Pattern;
import org.junit.Test;
/**
@@ -161,13 +162,19 @@
Collection<ChangeMessageInfo> messages = gApi.changes().id(changeId).get().messages;
assertThat(Iterables.getLast(messages).message)
- .isEqualTo(
- String.format(
- "Patch Set 1: Code-Review+1 Other+1\n\n"
- + "By voting Code-Review+1 the following files are still code-owner approved by"
- + " %s:\n"
- + "* %s\n",
- admin.fullName(), path));
+ .matches(
+ Pattern.quote("Patch Set 1: ")
+ + "("
+ + Pattern.quote("Code-Review+1 Other+1")
+ + "|"
+ + Pattern.quote("Other+1 Code-Review+1")
+ + ")"
+ + Pattern.quote(
+ String.format(
+ "\n\nBy voting Code-Review+1 the following files are still code-owner approved by"
+ + " %s:\n"
+ + "* %s\n",
+ admin.fullName(), path)));
}
@Test