Merge branch 'stable-3.4' into stable-3.5
* stable-3.4:
Adapt to new ProjectCache interface
Depends-On: https://gerrit-review.googlesource.com/c/gerrit/+/324619
Change-Id: I0bb21fd8c29337b53643fd31959ec891ded23d2e
diff --git a/BUILD b/BUILD
index d5a550f..d08738a 100644
--- a/BUILD
+++ b/BUILD
@@ -11,7 +11,7 @@
srcs = glob(["src/main/java/**/*.java"]),
manifest_entries = [
"Gerrit-PluginName: webhooks",
- "Gerrit-Module: com.googlesource.gerrit.plugins.webhooks.Module",
+ "Gerrit-Module: com.googlesource.gerrit.plugins.webhooks.PluginModule",
"Implementation-Title: webhooks plugin",
"Implementation-URL: https://gerrit-review.googlesource.com/#/admin/projects/plugins/webhooks",
"Implementation-Vendor: Gerrit Code Review",
diff --git a/src/main/java/com/googlesource/gerrit/plugins/webhooks/Module.java b/src/main/java/com/googlesource/gerrit/plugins/webhooks/PluginModule.java
similarity index 95%
rename from src/main/java/com/googlesource/gerrit/plugins/webhooks/Module.java
rename to src/main/java/com/googlesource/gerrit/plugins/webhooks/PluginModule.java
index edaaeff..a4d446f 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/webhooks/Module.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/webhooks/PluginModule.java
@@ -29,11 +29,11 @@
import java.util.concurrent.ScheduledExecutorService;
import org.apache.http.impl.client.CloseableHttpClient;
-public class Module extends FactoryModule {
+public class PluginModule extends FactoryModule {
private final ProcessorModule processors;
@Inject
- public Module(ProcessorModule processors) {
+ public PluginModule(ProcessorModule processors) {
this.processors = processors;
}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/webhooks/EventHandlerTest.java b/src/test/java/com/googlesource/gerrit/plugins/webhooks/EventHandlerTest.java
index 8fd1e9e..8baeb5b 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/webhooks/EventHandlerTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/webhooks/EventHandlerTest.java
@@ -17,7 +17,7 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import com.google.common.collect.ImmutableSet;
@@ -71,8 +71,8 @@
public void remoteUrlUndefinedTaskNotScheduled() {
when(config.getSubsections(eq(REMOTE))).thenReturn(ImmutableSet.of(FOO));
eventHandler.onEvent(projectCreated);
- verifyZeroInteractions(taskFactory);
- verifyZeroInteractions(postTask);
+ verifyNoInteractions(taskFactory);
+ verifyNoInteractions(postTask);
}
@Test
@@ -89,8 +89,8 @@
public void nonProjectEventNotProcessed() {
Event nonProjectEvent = new Event("non-project-event") {};
eventHandler.onEvent(nonProjectEvent);
- verifyZeroInteractions(remoteFactory);
- verifyZeroInteractions(taskFactory);
- verifyZeroInteractions(postTask);
+ verifyNoInteractions(remoteFactory);
+ verifyNoInteractions(taskFactory);
+ verifyNoInteractions(postTask);
}
}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/webhooks/PostTaskTest.java b/src/test/java/com/googlesource/gerrit/plugins/webhooks/PostTaskTest.java
index fddcfb6..a2aed68 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/webhooks/PostTaskTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/webhooks/PostTaskTest.java
@@ -17,7 +17,7 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import com.google.gerrit.entities.Project;
@@ -77,22 +77,22 @@
public void noScheduleOnEmptyBody() throws Exception {
when(processor.process(eq(projectCreated), eq(remote))).thenReturn(Optional.empty());
task.run();
- verifyZeroInteractions(session);
- verifyZeroInteractions(executor);
+ verifyNoInteractions(session);
+ verifyNoInteractions(executor);
}
@Test
public void noRescheduleOnSuccess() throws IOException {
when(session.post(eq(remote), eq(content))).thenReturn(OK_RESULT);
task.run();
- verifyZeroInteractions(executor);
+ verifyNoInteractions(executor);
}
@Test
public void noRescheduleOnNonRecoverableException() throws IOException {
when(session.post(eq(remote), eq(content))).thenThrow(SSLException.class);
task.run();
- verifyZeroInteractions(executor);
+ verifyNoInteractions(executor);
}
@Test
diff --git a/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java b/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java
index 0521a73..5b17a56 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java
@@ -34,7 +34,7 @@
import org.eclipse.jgit.transport.RefSpec;
import org.junit.Test;
-@TestPlugin(name = "webhooks", sysModule = "com.googlesource.gerrit.plugins.webhooks.Module")
+@TestPlugin(name = "webhooks", sysModule = "com.googlesource.gerrit.plugins.webhooks.PluginModule")
public class GetRemoteIT extends LightweightPluginDaemonTest {
@Test
diff --git a/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/UpdateRemoteIT.java b/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/UpdateRemoteIT.java
index cb6f0c7..4ffbf89 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/UpdateRemoteIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/UpdateRemoteIT.java
@@ -32,7 +32,7 @@
import org.junit.Before;
import org.junit.Test;
-@TestPlugin(name = "webhooks", sysModule = "com.googlesource.gerrit.plugins.webhooks.Module")
+@TestPlugin(name = "webhooks", sysModule = "com.googlesource.gerrit.plugins.webhooks.PluginModule")
public class UpdateRemoteIT extends LightweightPluginDaemonTest {
private String fooEndpoint;