Merge branch 'stable-2.14' into stable-2.15

* stable-2.14:
  GerritServer: save gerrit.config before site init
  ReindexIT: remove unnecessary method throws clause
  RestSession#postWithHeader: Make parameter order consistent with #putWithHeader
  Bump guice version to 4.2.0

Change-Id: Ibdedb3281414a140b214cb8c9006754cff542d25
This commit is contained in:
David Pursehouse 2018-07-22 09:48:32 +01:00
commit e978e864e6
8 changed files with 11 additions and 27 deletions

View File

@ -70,30 +70,24 @@ maven_jar(
sha1 = "83cd2cd674a217ade95a4bb83a8a14f351f48bd0", sha1 = "83cd2cd674a217ade95a4bb83a8a14f351f48bd0",
) )
GUICE_VERS = "4.1.0" GUICE_VERS = "4.2.0"
maven_jar( maven_jar(
name = "guice-library", name = "guice-library",
artifact = "com.google.inject:guice:" + GUICE_VERS, artifact = "com.google.inject:guice:" + GUICE_VERS,
sha1 = "eeb69005da379a10071aa4948c48d89250febb07", sha1 = "25e1f4c1d528a1cffabcca0d432f634f3132f6c8",
) )
maven_jar( maven_jar(
name = "guice-assistedinject", name = "guice-assistedinject",
artifact = "com.google.inject.extensions:guice-assistedinject:" + GUICE_VERS, artifact = "com.google.inject.extensions:guice-assistedinject:" + GUICE_VERS,
sha1 = "af799dd7e23e6fe8c988da12314582072b07edcb", sha1 = "e7270305960ad7db56f7e30cb9df6be9ff1cfb45",
) )
maven_jar( maven_jar(
name = "guice-servlet", name = "guice-servlet",
artifact = "com.google.inject.extensions:guice-servlet:" + GUICE_VERS, artifact = "com.google.inject.extensions:guice-servlet:" + GUICE_VERS,
sha1 = "90ac2db772d9b85e2b05417b74f7464bcc061dcb", sha1 = "f57581625c36c148f088d9f52a568d5bdf12c61d",
)
maven_jar(
name = "multibindings",
artifact = "com.google.inject.extensions:guice-multibindings:" + GUICE_VERS,
sha1 = "3b27257997ac51b0f8d19676f1ea170427e86d51",
) )
maven_jar( maven_jar(

View File

@ -116,10 +116,10 @@ public class RestSession extends HttpSession {
} }
public RestResponse post(String endPoint, Object content) throws IOException { public RestResponse post(String endPoint, Object content) throws IOException {
return postWithHeader(endPoint, content, null); return postWithHeader(endPoint, null, content);
} }
public RestResponse postWithHeader(String endPoint, Object content, Header header) public RestResponse postWithHeader(String endPoint, Header header, Object content)
throws IOException { throws IOException {
Request post = Request.Post(getUrl(endPoint)); Request post = Request.Post(getUrl(endPoint));
if (header != null) { if (header != null) {

View File

@ -18,5 +18,5 @@ import com.google.inject.Injector;
public class ReindexIT extends AbstractReindexTests { public class ReindexIT extends AbstractReindexTests {
@Override @Override
public void configureIndex(Injector injector) throws Exception {} public void configureIndex(Injector injector) {}
} }

View File

@ -470,7 +470,7 @@ public class ImpersonationIT extends AbstractDaemonTest {
in.drafts = DraftHandling.PUBLISH; in.drafts = DraftHandling.PUBLISH;
RestResponse res = RestResponse res =
adminRestSession.postWithHeader( adminRestSession.postWithHeader(
"/changes/" + r.getChangeId() + "/revisions/current/review", in, runAsHeader(user.id)); "/changes/" + r.getChangeId() + "/revisions/current/review", runAsHeader(user.id), in);
res.assertOK(); res.assertOK();
ChangeMessageInfo m = Iterables.getLast(gApi.changes().id(r.getChangeId()).get().messages); ChangeMessageInfo m = Iterables.getLast(gApi.changes().id(r.getChangeId()).get().messages);
@ -502,13 +502,13 @@ public class ImpersonationIT extends AbstractDaemonTest {
in.message = "Message on behalf of"; in.message = "Message on behalf of";
String endpoint = "/changes/" + r.getChangeId() + "/revisions/current/review"; String endpoint = "/changes/" + r.getChangeId() + "/revisions/current/review";
RestResponse res = adminRestSession.postWithHeader(endpoint, in, runAsHeader(user2.id)); RestResponse res = adminRestSession.postWithHeader(endpoint, runAsHeader(user2.id), in);
res.assertForbidden(); res.assertForbidden();
assertThat(res.getEntityContent()) assertThat(res.getEntityContent())
.isEqualTo("label required to post review on behalf of \"" + in.onBehalfOf + '"'); .isEqualTo("label required to post review on behalf of \"" + in.onBehalfOf + '"');
in.label("Code-Review", 1); in.label("Code-Review", 1);
adminRestSession.postWithHeader(endpoint, in, runAsHeader(user2.id)).assertOK(); adminRestSession.postWithHeader(endpoint, runAsHeader(user2.id), in).assertOK();
PatchSetApproval psa = Iterables.getOnlyElement(r.getChange().approvals().values()); PatchSetApproval psa = Iterables.getOnlyElement(r.getChange().approvals().values());
assertThat(psa.getPatchSetId().get()).isEqualTo(1); assertThat(psa.getPatchSetId().get()).isEqualTo(1);

View File

@ -1101,7 +1101,7 @@ public class ChangeRebuilderIT extends AbstractDaemonTest {
ci.message = "comment with impersonation"; ci.message = "comment with impersonation";
ri.message = "message with impersonation"; ri.message = "message with impersonation";
ri.label("Code-Review", 1); ri.label("Code-Review", 1);
adminRestSession.postWithHeader(prefix + "review", ri, runAs).assertOK(); adminRestSession.postWithHeader(prefix + "review", runAs, ri).assertOK();
di.message = "draft with impersonation"; di.message = "draft with impersonation";
adminRestSession.putWithHeader(prefix + "drafts", runAs, di).assertCreated(); adminRestSession.putWithHeader(prefix + "drafts", runAs, di).assertCreated();

View File

@ -24,7 +24,6 @@ EXPORTS = [
"//lib/guice:guice-assistedinject", "//lib/guice:guice-assistedinject",
"//lib/guice:guice-servlet", "//lib/guice:guice-servlet",
"//lib/guice:javax-inject", "//lib/guice:javax-inject",
"//lib/guice:multibindings",
"//lib/httpcomponents:httpclient", "//lib/httpcomponents:httpclient",
"//lib/httpcomponents:httpcore", "//lib/httpcomponents:httpcore",
"//lib/jgit/org.eclipse.jgit.http.server:jgit-servlet", "//lib/jgit/org.eclipse.jgit.http.server:jgit-servlet",

View File

@ -272,7 +272,6 @@ java_library(
"//lib/guice", "//lib/guice",
"//lib/guice:guice-assistedinject", "//lib/guice:guice-assistedinject",
"//lib/guice:javax-inject", "//lib/guice:javax-inject",
"//lib/guice:multibindings",
"//lib/ow2:ow2-asm", "//lib/ow2:ow2-asm",
"//lib/ow2:ow2-asm-analysis", "//lib/ow2:ow2-asm-analysis",
"//lib/ow2:ow2-asm-commons", "//lib/ow2:ow2-asm-commons",

View File

@ -5,7 +5,6 @@ java_library(
exports = [ exports = [
":guice-library", ":guice-library",
":javax-inject", ":javax-inject",
":multibindings",
], ],
) )
@ -45,10 +44,3 @@ java_library(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
exports = ["@javax_inject//jar"], exports = ["@javax_inject//jar"],
) )
java_library(
name = "multibindings",
data = ["//lib:LICENSE-Apache2.0"],
visibility = ["//visibility:public"],
exports = ["@multibindings//jar"],
)