when(project.getFullDisplayName()).thenReturn("MockedProject");
when(project.getFullName()).thenReturn("MockedProject");
PowerMockito.mockStatic(PluginImpl.class);
PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
GerritServer server = mock(GerritServer.class);
IGerritHudsonTriggerConfig config = Setup.createConfig();
config = spy(config);
doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
when(plugin.getServer(any(String.class))).thenReturn(server);
GerritHandler handler = mock(GerritHandler.class);
when(plugin.getHandler()).thenReturn(handler);
when(server.getConfig()).thenReturn(config);
PowerMockito.when(PluginImpl.getInstance()).thenReturn(plugin);
when(config.getBuildScheduleDelay()).thenReturn(20);
GerritTrigger trigger = Setup.createDefaultTrigger(project);
when(project.getTrigger(GerritTrigger.class)).thenReturn(trigger);
PatchsetCreated event = Setup.createPatchsetCreated();
GerritCause gerritCause = new GerritCause(event, true);