Account uploader = new Account("Nisse", "nisse@acme.org");
PowerMockito.mockStatic(PluginImpl.class);
PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
PowerMockito.when(PluginImpl.getInstance()).thenReturn(plugin);
GerritServer server = mock(GerritServer.class);
when(plugin.getServer(any(String.class))).thenReturn(server);
GerritHandler handler = mock(GerritHandler.class);
when(plugin.getHandler()).thenReturn(handler);
GerritTrigger trigger = Setup.createDefaultTrigger(project);
when(project.getTrigger(GerritTrigger.class)).thenReturn(trigger);
trigger.setEscapeQuotes(false);
PatchsetCreated event = Setup.createPatchsetCreatedWithAccounts(owner, null, uploader);
GerritCause gerritCause = new GerritCause(event, true);
gerritCause = spy(gerritCause);
doReturn("http://mock.url").when(gerritCause).getUrl();
IGerritHudsonTriggerConfig config = Setup.createConfig();
config = spy(config);
doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
when(server.getConfig()).thenReturn(config);
trigger.schedule(gerritCause, event);
verify(project).scheduleBuild2(
anyInt(),