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);
String parameterString = "gerrit review MSG=FAILED VERIFIED=<VERIFIED> CODEREVIEW=<CODE_REVIEW>";
when(config.getGerritCmdBuildFailed()).thenReturn(parameterString);
when(config.getGerritBuildSuccessfulVerifiedValue()).thenReturn(1);
when(config.getGerritBuildSuccessfulCodeReviewValue()).thenReturn(1);
when(config.getGerritBuildFailedCodeReviewValue()).thenReturn(-1);
when(config.getGerritBuildFailedVerifiedValue()).thenReturn(-1);
GerritNotifier notifier = new GerritNotifier(config, mockGerritCmdRunner, hudson);
notifier.buildCompleted(memory.getMemoryImprint(event), taskListener);
String parameterStringExpected = "gerrit review MSG=FAILED VERIFIED=-1 CODEREVIEW=-1";
verify(mockGerritCmdRunner).sendCommand(parameterStringExpected);
}