settings.appendProperty(GerritCommit.GERRIT_PATCH_KEY, "2");
GerritNotifier gerritNotifier = new GerritNotifier(settings, server, sonarResultEvaluator);
mockStatic(SshConnectionFactory.class);
SshConnection sshConnection = mock(SshConnection.class);
// when
when(sshConnection.isConnected()).thenReturn(true);
when(sshConnection.isAuthenticated()).thenReturn(true);
when(sshConnection.isSessionOpen()).thenReturn(true);
when(SshConnectionFactory.getConnection((GerritConnection) any())).thenReturn(sshConnection);
when(sshConnection.executeCommand(anyString())).thenReturn("OK");
when(sonarResultEvaluator.getResult(context, URL)).thenReturn(
new SonarAnalysisResult("message", SonarAnalysisStatus.NO_PROBLEMS));
gerritNotifier.executeOn(project, context);