EnvVars env = Setup.createEnvVars();
when(build.getEnvironment(taskListener)).thenReturn(env);
AbstractProject project = mock(AbstractProject.class);
when(build.getProject()).thenReturn(project);
GerritTrigger trigger = mock(GerritTrigger.class);
when(trigger.getGerritBuildSuccessfulCodeReviewValue()).thenReturn(null);
when(trigger.getGerritBuildSuccessfulVerifiedValue()).thenReturn(null);
when(project.getTrigger(GerritTrigger.class)).thenReturn(trigger);
PatchsetCreated event = Setup.createPatchsetCreated();
BuildMemory memory = new BuildMemory();
memory.completed(event, build);
build = mock(AbstractBuild.class);
when(build.getResult()).thenReturn(Result.FAILURE);
env = Setup.createEnvVars();
when(build.getEnvironment(taskListener)).thenReturn(env);
project = mock(AbstractProject.class);
when(build.getProject()).thenReturn(project);
trigger = mock(GerritTrigger.class);
when(trigger.getGerritBuildFailedCodeReviewValue()).thenReturn(null);
when(trigger.getGerritBuildFailedVerifiedValue()).thenReturn(null);
when(project.getTrigger(GerritTrigger.class)).thenReturn(trigger);
memory.completed(event, build);
IGerritHudsonTriggerConfig config = mock(IGerritHudsonTriggerConfig.class);