Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  Post/Delete GPG keys: Do not return 409 Conflict if an error occurred
  DeleteRef: Do not return 409 Conflict if an error occurred
  DeleteRef: Do not log an error if user attempted to delete the current branch
  Init: Increase severity log level to error on exceptions
  Bazel: Fix genrule2 to clean up temporary folder content
  AbstractIndexTests: Inline constant assertChangeQuery string parameter
  AbstractIndexTests: Align assertChangeQuery method access with its use
  AbstractIndexTests: Provide default configureIndex method implementation
  XContentBuilder: Use JsonFactory.builder() and new feature enums

Change-Id: Id3499febf123f2f3aa872d589b5df478d1d66b63
This commit is contained in:
David Pursehouse
2019-11-01 08:46:48 +09:00
8 changed files with 29 additions and 26 deletions

View File

@@ -41,7 +41,7 @@ public class ElasticReindexIT extends AbstractReindexTests {
}
@Override
public void configureIndex(Injector injector) throws Exception {
public void configureIndex(Injector injector) {
createAllIndexes(injector);
}

View File

@@ -57,7 +57,7 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
disableChangeIndexWrites();
amendChange(changeId, "second test", "test2.txt", "test2");
assertChangeQuery("message:second", change.getChange(), false);
assertChangeQuery(change.getChange(), false);
enableChangeIndexWrites();
changeIndexedCounter.clear();
@@ -67,7 +67,7 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
changeIndexedCounter.assertReindexOf(changeInfo, 1);
assertChangeQuery("message:second", change.getChange(), true);
assertChangeQuery(change.getChange(), true);
}
}
@@ -86,7 +86,7 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
disableChangeIndexWrites();
amendChange(changeId, "second test", "test2.txt", "test2");
assertChangeQuery("message:second", change.getChange(), false);
assertChangeQuery(change.getChange(), false);
enableChangeIndexWrites();
changeIndexedCounter.clear();
@@ -103,13 +103,12 @@ public abstract class AbstractIndexTests extends AbstractDaemonTest {
changeIndexedCounter.assertReindexOf(changeInfo, 1);
assertChangeQuery("message:second", change.getChange(), true);
assertChangeQuery(change.getChange(), true);
}
}
protected void assertChangeQuery(String q, ChangeData change, boolean assertTrue)
throws Exception {
List<Integer> ids = query(q).stream().map(c -> c._number).collect(toList());
private void assertChangeQuery(ChangeData change, boolean assertTrue) throws Exception {
List<Integer> ids = query("message:second").stream().map(c -> c._number).collect(toList());
if (assertTrue) {
assertThat(ids).contains(change.getId().get());
} else {