int expectedCodeReviewVote)
throws IOException, InterruptedException {
IGerritHudsonTriggerConfig config = Setup.createConfig();
Hudson hudson = PowerMockito.mock(Hudson.class);
when(hudson.getRootUrl()).thenReturn("http://localhost/");
TaskListener taskListener = mock(TaskListener.class);
GerritTrigger trigger = mock(GerritTrigger.class);
when(trigger.getGerritBuildSuccessfulVerifiedValue()).thenReturn(null);
when(trigger.getGerritBuildSuccessfulCodeReviewValue()).thenReturn(32);
when(trigger.getCustomUrl()).thenReturn(customUrl);
AbstractProject project = mock(AbstractProject.class);
when(project.getTrigger(GerritTrigger.class)).thenReturn(trigger);
EnvVars env = Setup.createEnvVars();
AbstractBuild r = Setup.createBuild(project, taskListener, env);
env.put("BUILD_URL", hudson.getRootUrl() + r.getUrl());
when(r.getResult()).thenReturn(Result.SUCCESS);
MemoryImprint memoryImprint = mock(MemoryImprint.class);
when(memoryImprint.getEvent()).thenReturn(event);