* gets called with correct change owner and uploader parameters when there are no default parameters present.
* And sets the event.patchSet.uploader to null keeping event.uploader set.
*/
@Test
public void testScheduleWithOwnerAndOtherUploaderNull() {
AbstractProject project = PowerMockito.mock(AbstractProject.class);
when(project.getFullDisplayName()).thenReturn("MockedProject");
when(project.getFullName()).thenReturn("MockedProject");
ParametersDefinitionProperty parameters = mock(ParametersDefinitionProperty.class);
when(parameters.getParameterDefinitions()).thenReturn(Collections.EMPTY_LIST);
when(project.getProperty(ParametersDefinitionProperty.class)).thenReturn(parameters);
Account owner = new Account("Bobby", "bobby@somewhere.com");
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();